From bcdfccc0390ecf6c037467ec02d736b9d707a037 Mon Sep 17 00:00:00 2001 From: Kostas Kyrimis Date: Tue, 23 Jul 2024 12:05:34 +0300 Subject: [PATCH] fix: protect OnJournalEntry with ConditionGuard (#3367) * add ConditionGuard on JournalEntry such that the stream state stays consistent Signed-off-by: kostas --- src/server/snapshot.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/snapshot.cc b/src/server/snapshot.cc index 093d0f80d..9ab735413 100644 --- a/src/server/snapshot.cc +++ b/src/server/snapshot.cc @@ -386,6 +386,7 @@ void SliceSnapshot::OnJournalEntry(const journal::JournalItem& item, bool await) // To enable journal flushing to sync after non auto journal command is executed we call // TriggerJournalWriteToSink. This call uses the NOOP opcode with await=true. Since there is no // additional journal change to serialize, it simply invokes PushSerializedToChannel. + ConditionGuard guard(&bucket_ser_); if (item.opcode != journal::Op::NOOP) { serializer_->WriteJournalEntry(item.data); }