Skip to content

Commit

Permalink
fix: crash during getting info about replication (#4328)
Browse files Browse the repository at this point in the history
  • Loading branch information
BorysTheDev authored and romange committed Dec 18, 2024
1 parent f4d3faa commit abf6d93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/server/rdb_save.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,10 @@ size_t RdbSaver::Impl::GetTotalBuffersSize() const {

auto cb = [this, &channel_bytes, &serializer_bytes](ShardId sid) {
auto& snapshot = shard_snapshots_[sid];
// before create a snapshot we save header so shard_snapshots_ are vector of nullptr until we
// start snapshots saving
if (!snapshot)
return;
if (channel_.has_value())
channel_bytes.fetch_add(channel_->GetSize(), memory_order_relaxed);
serializer_bytes.store(snapshot->GetBufferCapacity() + snapshot->GetTempBuffersSize(),
Expand All @@ -1393,6 +1397,10 @@ RdbSaver::SnapshotStats RdbSaver::Impl::GetCurrentSnapshotProgress() const {

auto cb = [this, &results](ShardId sid) {
auto& snapshot = shard_snapshots_[sid];
// before create a snapshot we save header so shard_snapshots_ are vector of nullptr until we
// start snapshots saving
if (!snapshot)
return;
results[sid] = snapshot->GetCurrentSnapshotProgress();
};

Expand Down

0 comments on commit abf6d93

Please sign in to comment.