Skip to content
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

Add verification on keys: should be always moronically increasing #17290

Closed
wants to merge 1 commit into from

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 22, 2024

Second solution to #17247.

This solution is much simpler, and easy to understand. But it only verifies the write buffer. It doesn't verify the merged data (write and read buffer).

It also adds unnecessary sorting and deduplicating on the Key bucket, so in theory it may have a little impact on the performance. Need to run benchmark to double confirm how much performance reduction it may lead to.

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
@@ -52,7 +54,20 @@ func (txw *txWriteBuffer) put(bucket Bucket, k, v []byte) {
}

func (txw *txWriteBuffer) putSeq(bucket Bucket, k, v []byte) {
// TODO: Add (in tests?) verification whether k>b[len(b)]
// putSeq is only be called for the data in the Key bucket. The keys
Copy link
Member

@serathius serathius Jan 25, 2024

Choose a reason for hiding this comment

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

Could we merge verify independent of the fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Raised PR #17325

@serathius
Copy link
Member

Can this be closed and work continued in #17263 ?

@ahrtr
Copy link
Member Author

ahrtr commented Jan 29, 2024

Can this be closed and work continued in #17263 ?

We can close this one, but we should double confirm #17247 (comment) before continuing to work on #17263

@ahrtr ahrtr closed this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants