Skip to content

Commit

Permalink
check for future times for leader commit msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Peters committed May 15, 2020
1 parent c682e99 commit 60113cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sqlitecluster/SQLiteNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2259,6 +2259,11 @@ void SQLiteNode::handleBeginTransaction(Peer* peer, const SData& message) {
commandIt->second->transaction = message;
}

// calculate and log replication timers
if (leaderSentTimestamp > followerDequeueTimestamp) {
SWARN("Leader replication timestamp is " << (leaderSentTimestamp - followerDequeueTimestamp) << " usecs newer than our timestamp. Possible clock synchronization issue.");
leaderSentTimestamp = followerDequeueTimestamp;
}
uint64_t transitTimeUS = followerDequeueTimestamp - leaderSentTimestamp;
uint64_t applyTimeUS = STimeNow() - followerDequeueTimestamp;
float transitTimeMS = (float)transitTimeUS / 1000.0;
Expand Down

0 comments on commit 60113cc

Please sign in to comment.