Skip to content

Commit

Permalink
use signed ints to compare rs optimes in stepdown
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Apr 12, 2011
1 parent 4762b20 commit 41631ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions db/repl/replset_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ namespace mongo {
// only step down if there is another node synced to within 10
// seconds of this node
if (!force) {
unsigned lastOp = theReplSet->lastOpTimeWritten.getSecs();
unsigned closest = theReplSet->lastOtherOpTime().getSecs();
long long int lastOp = (long long int)theReplSet->lastOpTimeWritten.getSecs();
long long int closest = (long long int)theReplSet->lastOtherOpTime().getSecs();

int diff = lastOp - closest;
long long int diff = lastOp - closest;
result.append("closest", closest);
result.append("difference", diff);

Expand Down

0 comments on commit 41631ef

Please sign in to comment.