fix: crash during getting info about replication (#4328)

This commit is contained in:
Borys
2024-12-18 08:44:24 +02:00
committed by Roman Gershman
parent f4d3faaa26
commit abf6d93c58

View File

@ -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(),
@ -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();
};