From 1e196fb8518a6ff3c82a25f520ec954de80f8e39 Mon Sep 17 00:00:00 2001 From: Kristina Date: Tue, 14 Dec 2010 10:09:31 -0500 Subject: [PATCH] check that latest writes haven't changed in repl tests --- shell/servers.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/servers.js b/shell/servers.js index 614398b105d..34b68e3403b 100644 --- a/shell/servers.js +++ b/shell/servers.js @@ -1357,6 +1357,11 @@ ReplSetTest.prototype.awaitReplication = function() { printjson( entry ); var ts = entry['ts']; print("TS for " + slave + " is " + ts.t+":"+ts.i + " and latest is " + latest.t+":"+latest.i); + + if (latest.t < ts.t || (latest.t == ts.t && latest.i < ts.i)) { + latest = this.liveNodes.master.getDB("local")['oplog.rs'].find({}).sort({'$natural': -1}).limit(1).next()['ts']; + } + print("Oplog size for " + slave + " is " + log.count()); synced = (synced && friendlyEqual(latest,ts)) }