From 61a5a3b2e13a2119e9d004174dbcfdbf18365024 Mon Sep 17 00:00:00 2001 From: Borys Date: Tue, 17 Dec 2024 15:18:23 +0200 Subject: [PATCH] fix: crash during getting info about replication --- src/server/rdb_save.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server/rdb_save.cc b/src/server/rdb_save.cc index 516b5d67f9d2..61f8659122d3 100644 --- a/src/server/rdb_save.cc +++ b/src/server/rdb_save.cc @@ -1333,6 +1333,8 @@ size_t RdbSaver::Impl::GetTotalBuffersSize() const { auto cb = [this, &channel_bytes, &serializer_bytes](ShardId sid) { auto& snapshot = shard_snapshots_[sid]; + if (!snapshot) + return; if (channel_.has_value()) channel_bytes.fetch_add(channel_->GetSize(), memory_order_relaxed); serializer_bytes.store(snapshot->GetBufferCapacity() + snapshot->GetTempBuffersSize(), @@ -1355,6 +1357,8 @@ RdbSaver::SnapshotStats RdbSaver::Impl::GetCurrentSnapshotProgress() const { auto cb = [this, &results](ShardId sid) { auto& snapshot = shard_snapshots_[sid]; + if (!snapshot) + return; results[sid] = snapshot->GetCurrentSnapshotProgress(); };