disable vid reuse compaction (#2276)

The current implementation cannot be used practically since it causes
several full reallocations of the whole free list per deletion - it
needs to be reimplemented, or the chain cannot practically progress
beyond ~2.5M blocks where a lot of removals happen.

Co-authored-by: tersec <tersec@users.noreply.github.com>
This commit is contained in:
Jacek Sieka 2024-06-01 17:14:54 +02:00 committed by GitHub
parent 9f879406f3
commit ef864ba167
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 4 deletions

View File

@ -300,8 +300,13 @@ proc delSubTreeImpl(
db.layersPutVtx(VertexID(1), wp.vid, leaf)
db.layersResKey(VertexID(1), wp.vid)
# Squeze list of recycled vertex IDs
db.top.final.vGen = db.vGen.vidReorg()
# Squeeze list of recycled vertex IDs
# TODO this causes a reallocation of vGen which slows down subsequent
# additions to the list because the sequence must grow which entails a
# full copy in addition to this reorg itself - around block 2.5M this
# causes significant slowdown as the vid list is >1M entries long
# See also EIP-161 which is why there are so many deletions
# db.top.final.vGen = db.vGen.vidReorg()
ok()
@ -393,8 +398,13 @@ proc deleteImpl(
db.layersPutVtx(VertexID(1), wp.vid, leaf)
db.layersResKey(VertexID(1), wp.vid)
# Squeze list of recycled vertex IDs
db.top.final.vGen = db.vGen.vidReorg()
# Squeeze list of recycled vertex IDs
# TODO this causes a reallocation of vGen which slows down subsequent
# additions to the list because the sequence must grow which entails a
# full copy in addition to this reorg itself - around block 2.5M this
# causes significant slowdown as the vid list is >1M entries long
# See also EIP-161 which is why there are so many deletions```
# db.top.final.vGen = db.vGen.vidReorg()
ok(emptySubTreeOk)
# ------------------------------------------------------------------------------