diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index e4b272ab37..551fdcacf0 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -1082,13 +1082,30 @@ Future< vector< pair> > > getKeyRangeLocations( ACTOR Future warmRange_impl( Transaction *self, Database cx, KeyRange keys ) { state int totalRanges = 0; + state int totalRequests = 0; loop { vector>> locations = wait(getKeyRangeLocations_internal(cx, keys, CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT, false, self->info)); totalRanges += CLIENT_KNOBS->WARM_RANGE_SHARD_LIMIT; + totalRequests++; if(locations.size() == 0 || totalRanges >= cx->locationCacheSize || locations[locations.size()-1].first.end >= keys.end) break; keys = KeyRangeRef(locations[locations.size()-1].first.end, keys.end); + + if(totalRequests%20 == 0) { + //To avoid blocking the proxies from starting other transactions, occasionally get a read version. + state Transaction tr(cx); + loop { + try { + tr.setOption( FDBTransactionOptions::LOCK_AWARE ); + tr.setOption( FDBTransactionOptions::CAUSAL_READ_RISKY ); + Version _ = wait( tr.getReadVersion() ); + break; + } catch( Error &e ) { + Void _ = wait( tr.onError(e) ); + } + } + } } return Void(); diff --git a/fdbserver/QuietDatabase.actor.cpp b/fdbserver/QuietDatabase.actor.cpp index f844716133..7f1936d3be 100644 --- a/fdbserver/QuietDatabase.actor.cpp +++ b/fdbserver/QuietDatabase.actor.cpp @@ -292,7 +292,7 @@ ACTOR Future waitForQuietDatabase( Database cx, ReferenceisSimulated()) Void _ = wait(delay(5.0)); - //Require 2 consecutive successful quiet database checks spaced 1 second apart + //Require 3 consecutive successful quiet database checks spaced 2 second apart state int numSuccesses = 0; loop { @@ -322,7 +322,7 @@ ACTOR Future waitForQuietDatabase( Database cx, Reference runTests( Reference