Skip to content

Conversation

cody-littley
Copy link
Contributor

Why are these changes needed?

Fixes the following issues:

  • LittDB size metric is inaccurate after restart
  • LittDB key count metric is inaccurate after restart
  • LittDB key files can be partially corrupted if running with multiple shards

Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley requested review from dmanc and litt3 May 19, 2025 14:32
litt3
litt3 previously approved these changes May 19, 2025
@cody-littley cody-littley marked this pull request as ready for review May 20, 2025 13:46
Signed-off-by: Cody Littley <[email protected]>
@cody-littley cody-littley merged commit 0188f60 into master May 20, 2025
15 checks passed
@cody-littley cody-littley deleted the littdb-consistent-keyfiles branch May 20, 2025 14:36
@@ -85,23 +87,23 @@ func newLevelDBKeymap(
return kmap, requiresReload, nil
}

func (l *LevelDBKeymap) Put(pairs []*types.KAPair) error {
func (l *LevelDBKeymap) Put(keys []*types.ScopedKey) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we've already discussed about this:

  • the Put failed if any key is duplicated.
  • Is this the intended behavior?
    • I believe it's ok in most circumstances.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally semantic of Put operations are different between LevelDBKeymap, and the memkeymap that:

  • leveldb: entire keys are not stored if any key is duplicated.
  • mem: some keys might be stored even if any key is duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants