Skip to content

Commit cd93f5f

Browse files
committed
SERVER-8487 Fix broken condition in oplog reader code.
1 parent cdd7654 commit cd93f5f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/mongo/db/oplog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ namespace mongo {
100100
ctx.getClient()->setLastOp( ts );
101101
}
102102
}
103+
104+
OpTime::setLast( ts );
103105
}
104106

105107
/** given a BSON object, create a new one at dst which is the existing (partial) object

src/mongo/util/optime.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ namespace mongo {
4242
public:
4343
static void setLast(const Date_t &date) {
4444
mutex::scoped_lock lk(m);
45-
notifier.notify_all(); // won't really do anything until write-lock released
4645
last = OpTime(date);
46+
notifier.notify_all();
4747
}
48+
static void setLast(const OpTime &new_last) {
49+
mutex::scoped_lock lk(m);
50+
last = new_last;
51+
notifier.notify_all();
52+
}
53+
4854
unsigned getSecs() const {
4955
return secs;
5056
}

0 commit comments

Comments
 (0)