Skip to content

Commit

Permalink
Merge pull request #794 from Expensify/fix_impossible_dequeue_values
Browse files Browse the repository at this point in the history
check for future times for leader commit msgs
  • Loading branch information
tylerkaraszewski committed May 15, 2020
2 parents c682e99 + 60113cc commit ba4eb87
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 ba4eb87

Please sign in to comment.