From 75ec56bffb44280dcc753c686caafcc8571befd2 Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Tue, 20 Jun 2023 16:02:12 -0700 Subject: [PATCH] When redoing a key location request, wait until after we've checked whether we've satisfied our min rows --- fdbclient/NativeAPI.actor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index f122e09882..c097921287 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -4400,6 +4400,7 @@ Future getExactRange(Reference trState, KeyRangeRef(keyAfter(output[output.size() - 1].key), locations[shard].range.end); } + bool redoKeyLocationRequest = false; if (!more || locations[shard].range.empty()) { CODE_PROBE(true, "getExactrange (!more || locations[shard].first.empty())"); if (shard == locations.size() - 1) { @@ -4411,10 +4412,9 @@ Future getExactRange(Reference trState, output.more = false; return output; } - CODE_PROBE(true, "Multiple requests of key locations"); keys = KeyRangeRef(begin, end); - break; + redoKeyLocationRequest = true; } ++shard; @@ -4428,6 +4428,10 @@ Future getExactRange(Reference trState, return output; } + if (redoKeyLocationRequest) { + CODE_PROBE(true, "Multiple requests of key locations"); + break; + } } catch (Error& e) { if (e.code() == error_code_wrong_shard_server || e.code() == error_code_all_alternatives_failed) { const KeyRangeRef& range = locations[shard].range;