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

mito: Checks the entry id returned while opening the region #3042

Closed
evenyag opened this issue Dec 29, 2023 · 1 comment · Fixed by #3073
Closed

mito: Checks the entry id returned while opening the region #3042

evenyag opened this issue Dec 29, 2023 · 1 comment · Fixed by #3073
Labels
A-storage Involves code in storage engines

Comments

@evenyag
Copy link
Contributor

evenyag commented Dec 29, 2023

What type of enhancement is this?

Other

What does the enhancement do?

We should check the entry id while replaying the region

let mut wal_stream = wal.scan(region_id, replay_from_entry_id, wal_options)?;
while let Some(res) = wal_stream.next().await {
let (entry_id, entry) = res?;

If the actual entry id in the WAL is less than the flushed entry id, raft-engine might panic while writing into the memtable.

Maybe related to #3041

Implementation challenges

We might provide different recovery mode

  • For strict mode we might return error
  • For truncate mode we can ignore entry id less than flushed entry id and truncate the WAL
@evenyag evenyag added the A-storage Involves code in storage engines label Dec 29, 2023
@v0y4g3r
Copy link
Contributor

v0y4g3r commented Jan 3, 2024

Maybe I should also address this issue in #3073

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-storage Involves code in storage engines
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants