mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-10 18:05:44 +02:00
fix(server): lag is 0 when server not in stable state (#3010)
* fix server: lag is 0 when server not in stable state Signed-off-by: adi_holden <adi@dragonflydb.io>
This commit is contained in:
parent
816cec12ed
commit
135af96f2f
1 changed files with 3 additions and 3 deletions
|
@ -688,13 +688,13 @@ std::vector<ReplicaRoleInfo> DflyCmd::GetReplicasRoleInfo() const {
|
|||
// the same applies of course if its state is not STABLE_SYNC.
|
||||
if (info->mu.try_lock()) {
|
||||
state = info->replica_state;
|
||||
// If the replica is not in stable sync, its lag is undefined, so we set it as max.
|
||||
// If the replica is not in stable sync, its lag is undefined, so we set it to 0.
|
||||
if (state != SyncState::STABLE_SYNC) {
|
||||
lag = std::numeric_limits<LSN>::max();
|
||||
lag = 0;
|
||||
}
|
||||
info->mu.unlock();
|
||||
} else {
|
||||
lag = std::numeric_limits<LSN>::max();
|
||||
lag = 0;
|
||||
}
|
||||
vec.push_back(
|
||||
ReplicaRoleInfo{info->id, info->address, info->listening_port, SyncStateName(state), lag});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue