From f2beea161e769f7bc70a5994c16337e605f4e748 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 2 Jun 2011 00:48:54 -0400 Subject: [PATCH] SERVER-2009 don't skip location on yield recovery when the location has already been updated --- db/clientcursor.cpp | 7 +++++-- jstests/remove9.js | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/db/clientcursor.cpp b/db/clientcursor.cpp index 4ce90050f6835..d9888f05c17a8 100644 --- a/db/clientcursor.cpp +++ b/db/clientcursor.cpp @@ -231,10 +231,13 @@ namespace mongo { c->checkLocation(); DiskLoc tmp1 = c->refLoc(); if ( tmp1 != dl ) { - /* this might indicate a failure to call ClientCursor::updateLocation() */ + // This might indicate a failure to call ClientCursor::updateLocation() but it can + // also happen during correct operation, see SERVER-2009. problem() << "warning: cursor loc " << tmp1 << " does not match byLoc position " << dl << " !" << endl; } - c->advance(); + else { + c->advance(); + } if ( c->eof() ) { // advanced to end // leave ClientCursor in place so next getMore doesn't fail diff --git a/jstests/remove9.js b/jstests/remove9.js index 25e7f85cf40ff..655594afe8b18 100644 --- a/jstests/remove9.js +++ b/jstests/remove9.js @@ -1,6 +1,5 @@ // SERVER-2009 Count odd numbered entries while updating and deleting even numbered entries. -if ( 0 ) { // SERVER-2009 t = db.jstests_remove9; t.drop(); t.ensureIndex( {i:1} ); @@ -15,4 +14,3 @@ for( i = 0; i < 1000; ++i ) { } s(); -} \ No newline at end of file