Skip to content

Commit

Permalink
feat: update flushed manifest version after replaying
Browse files Browse the repository at this point in the history
  • Loading branch information
killme2008 committed Aug 22, 2023
1 parent bdc3f1d commit a5a8df3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/storage/src/manifest/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ pub struct RegionManifestCheckpointer {

impl RegionManifestCheckpointer {
pub(crate) fn set_flushed_manifest_version(&self, manifest_version: ManifestVersion) {
let current = self.flushed_manifest_version.load(Ordering::Relaxed);

self.flushed_manifest_version
.store(manifest_version, Ordering::Relaxed);
.store(current.max(manifest_version), Ordering::Relaxed);
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/storage/src/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ impl<S: LogStore> RegionImpl<S> {
.replay(recovered_metadata_after_flushed, writer_ctx)
.await?;

// Update flushed manifest version after replaying
store_config
.manifest
.set_flushed_manifest_version(shared.version_control.current().manifest_version());

let inner = Arc::new(RegionInner {
shared,
writer,
Expand Down

0 comments on commit a5a8df3

Please sign in to comment.