db/kv/membatchwithdb: DeleteCurrent after ClearTable deletes the previous key

Open
#26,469 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@yperbasis is already working on this.

Since Nov 17, 2026.

Assessment

This issue has not been assessed yet.

Description

After ClearTable, an overlay cursor's DeleteCurrent deletes the key it was on before the seek.

  • Case: a HeaderNumber cursor on A; clear the table, put A and B, SeekExact(B), then DeleteCurrent().
  • With the table cleared, Seek returns memCursor.Seek directly and leaves currentPair at A.
  • DeleteCurrent deletes currentPair.key, so A goes and B stays.
  • Direction: keep currentPair in step on the cleared-table paths, or delegate DeleteCurrent to memCursor when the table is cleared.

Present on main; found reviewing #26444.

Dominant language
Go
Stars
3.6k
Forks
1.6k
Avg merge
1d 17h
Merged PRs (30d)
820

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from erigontech/erigon

All issues in erigontech/erigon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.