-
Notifications
You must be signed in to change notification settings - Fork 20.9k
ethdb: Implement DeleteRange in batch #31947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Please fix the compilation. |
23a61a6
to
6f76fec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
core/rawdb/table.go
Outdated
// The nilness will be lost by adding the prefix, explicitly converting it | ||
// to a special flag representing the end of key range. | ||
if end == nil { | ||
end = bytes.Repeat([]byte{0xff}, 32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this have an issue if the key is larger than 32 bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. The only possible scenario to hit this scenario is hash-based trie node key, which can in theory be bytes.Repeat([]byte{0xff}, 32)
. It's the rationale I choose this value as the special marker.
Btw, we also use it for Pebble compaction.
implement #31945