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

Fix issue with sparse reading a segment that is being modified. #503

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

kjnilsson
Copy link
Contributor

When a sparse read detects a modified segment and re-initialises it is possible that the segment will again be modified before the second read attempt. It is not necessary in this case to check if the segment has been modified as the read plan would have been generated before the segment was re-initialised so this commit introduces a new ra_log_segment:read_sparse_no_checks function that skips the modified check to avoid a crash.

@kjnilsson kjnilsson added this to the 2.16.0 milestone Jan 21, 2025
@kjnilsson kjnilsson force-pushed the read-plan-modified-fix branch from 3c4917b to 87ea602 Compare January 21, 2025 10:47
src/ra_log_segment.erl Outdated Show resolved Hide resolved
When a sparse read detects a modified segment and re-initialises
it is possible that the segment will again be modified before the
second read attempt. It is not necessary in this case to check
if the segment has been modified as the read plan would have been
generated before the segment was re-initialised so this commit
introduces a new ra_log_segment:read_sparse_no_checks function
that skips the modified check to avoid a crash.
@kjnilsson kjnilsson force-pushed the read-plan-modified-fix branch from 87ea602 to fd711b7 Compare January 22, 2025 16:03
@kjnilsson kjnilsson merged commit 0123418 into main Jan 22, 2025
6 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