SeekGC doesn't iterate through all entities in BoltDB #1534

Open
opened 2025-12-28 17:16:46 +00:00 by sami · 0 comments
Owner

Originally created by @AnnaShaleva on GitHub (Jul 2, 2025).

Current Behavior

Ref. https://github.com/nspcc-dev/neo-go/pull/3922#discussion_r2130309556. If during SEEK we remove some entities in the same transaction, BoltDB may automatically move cursor forward which will lead to the fact that one KV pair is skipped after removal. So SeekGC doesn't actually iterate through all entities in the DB.

Expected Behavior

SeekGC iterates through all entities in the DB.

Possible Solution

Two-stepped removal: collect entities in the first transaction, remove them in the second one.

Originally created by @AnnaShaleva on GitHub (Jul 2, 2025). ## Current Behavior Ref. https://github.com/nspcc-dev/neo-go/pull/3922#discussion_r2130309556. If during SEEK we remove some entities in the same transaction, BoltDB may automatically move cursor forward which will lead to the fact that one KV pair is skipped after removal. So SeekGC doesn't actually iterate through all entities in the DB. ## Expected Behavior SeekGC iterates through all entities in the DB. ## Possible Solution Two-stepped removal: collect entities in the first transaction, remove them in the second one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neo-go#1534
No description provided.