mirror of
https://github.com/dragonflydb/dragonfly
synced 2024-11-22 15:44:13 +00:00
fix: protect OnJournalEntry with ConditionGuard (#3367)
* add ConditionGuard on JournalEntry such that the stream state stays consistent Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
parent
cd0e03a737
commit
bcdfccc039
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user