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

commitlog: Fix offset index truncation #2073

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

kim
Copy link
Contributor

@kim kim commented Dec 19, 2024

Fix the ftruncate implementation for the offset index writer to use the correct argument (transaction not byte offset). Add a test for it.

Also change the commitlog reset_to method to truncate to offset + 1, so as to retain the offset in the index if it is there. This matches the semantics of reset_to, which keeps the given offset.

Expected complexity level and risk

1

Testing

This patch adds a test.

Fix the `ftruncate` implementation for the offset index writer to use
the correct argument (transaction not byte offset). Add a test for it.

Also change the commitlog `reset_to` method to truncate to `offset + 1`,
so as to retain the `offset` in the index if it is there. This matches
the semantics of `reset_to`, which keeps the given offset.
@kim kim requested a review from Shubham8287 December 19, 2024 15:07
Copy link
Contributor

@Shubham8287 Shubham8287 left a comment

Choose a reason for hiding this comment

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

Thanks for test

@kim kim added this pull request to the merge queue Dec 19, 2024
Merged via the queue into master with commit a191055 Dec 19, 2024
9 checks passed
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.

2 participants