From adb8d3ec7a2c9bd3fc6eb772b7b728830f036f79 Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Mon, 23 Jan 2023 11:01:37 -0800 Subject: [PATCH] Fix a memory issue when getting key range locations that manifests in particular when getting range split points --- 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 2aa8d28b11..90dd2e1e38 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -3015,7 +3015,9 @@ Future getKeyLocation(Reference trState, trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), trState->useProvisionalProxies, isBackward, - trState->readVersionFuture.isReady() ? trState->readVersion() : latestVersion); + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); } ACTOR Future> getKeyRangeLocations_internal( @@ -3132,7 +3134,9 @@ Future> getKeyRangeLocations(ReferencespanContext, trState->readOptions.present() ? trState->readOptions.get().debugID : Optional(), trState->useProvisionalProxies, - trState->readVersionFuture.isReady() ? trState->readVersion() : latestVersion); + trState->readVersionFuture.isValid() && trState->readVersionFuture.isReady() + ? trState->readVersion() + : latestVersion); } ACTOR Future warmRange_impl(Reference trState, KeyRange keys) {