summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2011-12-12 10:39:58 -0500
committerGreg Studer <greg@10gen.com>2011-12-12 10:51:10 -0500
commit6759c3ffa15febc7698442772f8c02075d35641a (patch)
tree8452f97decc9910a29343d535a8f20215f583ce2
parent9e517db3e1aa09d5cdf5edc5a574f5774af1c92a (diff)
downloadmongo-6759c3ffa15febc7698442772f8c02075d35641a.tar.gz
SERVER-4465 wait for refresh if multiple retries fail for sharded count()
-rw-r--r--s/commands_public.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/s/commands_public.cpp b/s/commands_public.cpp
index d962e9c7a3f..23dd7fecbc6 100644
--- a/s/commands_public.cpp
+++ b/s/commands_public.cpp
@@ -439,6 +439,10 @@ namespace mongo {
while ( numTries < 5 ) {
numTries++;
+ // This all should eventually be replaced by new pcursor framework, but for now match query
+ // retry behavior manually
+ if( numTries >= 2 ) sleepsecs( numTries - 1 );
+
if ( ! cm ) {
// probably unsharded now
return run( dbName , cmdObj , options , errmsg , result, false );