greatsharp commented on code in PR #3271:
URL: https://github.com/apache/kvrocks/pull/3271#discussion_r2566848828
##########
src/server/server.cc:
##########
@@ -1215,24 +1215,25 @@ Server::InfoEntries Server::GetReplicationInfo() {
}
int idx = 0;
- rocksdb::SequenceNumber latest_seq = storage->LatestSeqNumber();
{
std::shared_lock<std::shared_mutex> guard(slave_threads_mu_);
entries.emplace_back("connected_slaves", slave_threads_.size());
+ rocksdb::SequenceNumber latest_seq = storage->LatestSeqNumber();
for (const auto &slave : slave_threads_) {
if (slave->IsStopped()) continue;
+ auto slave_ack_seq = slave->GetAckSeq();
entries.emplace_back(
"slave" + std::to_string(idx),
fmt::format("ip={},port={},offset={},lag={}",
slave->GetConn()->GetAnnounceIP(),
- slave->GetConn()->GetAnnouncePort(), slave->GetAckSeq(),
latest_seq - slave->GetAckSeq()));
+ slave->GetConn()->GetAnnouncePort(), slave_ack_seq >=
latest_seq ? latest_seq : slave_ack_seq,
Review Comment:
if slave_ack_seq > latest_seq, then offset > master_repl_offset, but the lag
is 0, it looks like mismatch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]