Skip to content

Commit 61a5a3b

Browse files
committed
fix: crash during getting info about replication
1 parent 0fe5e86 commit 61a5a3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/server/rdb_save.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,8 @@ size_t RdbSaver::Impl::GetTotalBuffersSize() const {
13331333

13341334
auto cb = [this, &channel_bytes, &serializer_bytes](ShardId sid) {
13351335
auto& snapshot = shard_snapshots_[sid];
1336+
if (!snapshot)
1337+
return;
13361338
if (channel_.has_value())
13371339
channel_bytes.fetch_add(channel_->GetSize(), memory_order_relaxed);
13381340
serializer_bytes.store(snapshot->GetBufferCapacity() + snapshot->GetTempBuffersSize(),
@@ -1355,6 +1357,8 @@ RdbSaver::SnapshotStats RdbSaver::Impl::GetCurrentSnapshotProgress() const {
13551357

13561358
auto cb = [this, &results](ShardId sid) {
13571359
auto& snapshot = shard_snapshots_[sid];
1360+
if (!snapshot)
1361+
return;
13581362
results[sid] = snapshot->GetCurrentSnapshotProgress();
13591363
};
13601364

0 commit comments

Comments
 (0)