From e344ae507aba426c2f12ccbc254f6f1b304959c8 Mon Sep 17 00:00:00 2001 From: Qi Xu Date: Fri, 22 Mar 2024 14:37:49 -0700 Subject: [PATCH] fix manifest LSN issue Signed-off-by: Qi Xu --- db/wal_edit.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db/wal_edit.cc b/db/wal_edit.cc index fb7018dd098..ee159b08b3d 100644 --- a/db/wal_edit.cc +++ b/db/wal_edit.cc @@ -17,9 +17,9 @@ void WalAddition::EncodeTo(std::string* dst) const { if (metadata_.HasSyncedSize()) { PutVarint32(dst, static_cast(WalAdditionTag::kSyncedSize)); PutVarint64(dst, metadata_.GetSyncedSizeInBytes()); - PutVarint32(dst, static_cast(WalAdditionTag::kLastSyncSeq)); - PutVarint64(dst, metadata_.GetLastSequence()); } + PutVarint32(dst, static_cast(WalAdditionTag::kLastSyncSeq)); + PutVarint64(dst, metadata_.GetLastSequence()); PutVarint32(dst, static_cast(WalAdditionTag::kTerminate)); } @@ -151,6 +151,7 @@ Status WalSet::AddWal(const WalAddition& wal) { // Update synced size for the given WAL. it->second.SetSyncedSizeInBytes(wal.GetMetadata().GetSyncedSizeInBytes()); + it->second.SetLastSequence(wal.GetMetadata().GetLastSequence()); return Status::OK(); }