mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-03-14 10:01:52 +00:00
fix: crash during getting info about replication (#4328)
This commit is contained in:
@ -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();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user