Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
106db9b
update version after 7.1.15 release
foundationdb-ci Jul 11, 2022
b5e7ff3
Add 7.1.14 and 7.1.15 release notes
jzhou77 Jul 11, 2022
867956c
Merge pull request #7562 from jzhou77/release-7.1
jzhou77 Jul 11, 2022
e96343d
Adding rocksdb compression and data size stats.
neethuhaneesha Jul 7, 2022
e98b32f
Fix processDiskReadSeconds and processDiskWriteSeconds. (#7609)
Jul 18, 2022
7f9ee8c
cherry pick 7613 - update tag client cache on getKeyLocation (#7616)
dlambrig Jul 19, 2022
9819054
Fix ScopeEventFieldTypeMismatch error for TLogMetrics
jzhou77 Jul 20, 2022
ef06bc4
Add getMappedRange latency metrics
jzhou77 Jul 19, 2022
c4fbc0b
Increase AllTags field length in TLogReady
halfprice Jul 20, 2022
5891f8b
Log tlog initialization
halfprice Jul 20, 2022
ea95420
cherry pick 7653 - Track when version not found in version vector.
dlambrig Jul 22, 2022
f7a6c1d
Add TraceEvent to the construction/destruction of DatabaseContext
xis19 Jul 22, 2022
dd1a145
fixup! Update code per comments
xis19 Jul 22, 2022
d04976d
Add CommitDebug event after Commit Proxy reporting committed version …
halfprice Jul 21, 2022
eee02bf
Respond to review comments.
dlambrig Jul 25, 2022
bd94146
Error in FetchKey GRV shouldn't fail storageserver
halfprice Jul 24, 2022
3da627b
Add testing mechanism
halfprice Jul 25, 2022
7fb2146
Add timeout to places during Status generation
jzhou77 Jul 24, 2022
1a83855
Fix test failure when getting wiggle value timed out
jzhou77 Jul 24, 2022
cbd11a2
Reduce a DNS lookup in Status generation
jzhou77 Jul 24, 2022
ed6e29b
TLog track unpopped recovery tag
halfprice Jul 25, 2022
6cc4170
Merge pull request #7700 from halfprice/zhewu/tlog-track-unpopped-rec…
jzhou77 Jul 26, 2022
be05459
Fix a crash bug during CC shutdown process
jzhou77 Jul 26, 2022
f252cea
Merge pull request #7706 from jzhou77/release-7.1
jzhou77 Jul 26, 2022
65cc170
disable AVX for 7.1.16 release
foundationdb-ci Jul 26, 2022
adc3f0b
enable AVX and update version for 7.1.17 release
foundationdb-ci Jul 26, 2022
9914e7c
Add 7.1.16, 7.1.17 release notes
jzhou77 Jul 27, 2022
12a0324
Merge pull request #7717 from jzhou77/release-7.1
jzhou77 Jul 27, 2022
1df82c5
Validate subrange reads in simulation (#7597) (#7720)
sfc-gh-clin Jul 28, 2022
a62282a
Fix bug where too many logs were generated.
dlambrig Jul 29, 2022
b4ba9ae
Merge branch 'release-7.1' into cherry7653
dlambrig Jul 29, 2022
8bfbc27
Add g_traceBatch for prefetch query (#7730) (#7732)
flowguru Jul 29, 2022
1ce8b6e
Prefer IPv6 in hostname resolving. (#7750)
Aug 1, 2022
9c10502
Retain debug id in prefetch server-server call (#7755)
flowguru Aug 2, 2022
4f90372
Add test coverage for SpecialKeyRangeAsyncImpl::getRange(release-7.1)…
sfc-gh-clin Aug 4, 2022
fcad3b0
Merge branch 'release-7.1' into cherry7653
dlambrig Aug 7, 2022
e202a39
Add knobs for min/max Ratekeeper limit
jzhou77 Aug 8, 2022
b718703
Merge pull request #7820 from jzhou77/release-7.1
jzhou77 Aug 9, 2022
c9b3203
Added 7.1.18, 7.1.19 release notes
jzhou77 Aug 9, 2022
7e95cd7
update version after 7.1.17 release
foundationdb-ci Aug 9, 2022
4e8b4db
disable AVX for 7.1.18 release
foundationdb-ci Aug 9, 2022
4738614
enable AVX and update version for 7.1.19 release
foundationdb-ci Aug 9, 2022
766debf
Merge pull request #7831 from jzhou77/release-7.1
jzhou77 Aug 9, 2022
b4e9105
update version after 7.1.19 release
foundationdb-ci Aug 10, 2022
fd24a07
Add fault injection to GRV proxy to return error response
jzhou77 Aug 10, 2022
0fd57b8
Client needs to handle proxy_memory_limit_exceeded error
jzhou77 Aug 10, 2022
3d8257c
Add retry in waitForCommittedVersion for GRV error response
jzhou77 Aug 10, 2022
c5c8e73
Fix backup worker to handle GRV errors
jzhou77 Aug 10, 2022
b99ecfd
Fix FuzzApiCorrectness workload
jzhou77 Aug 10, 2022
def709c
Fix SpecialKeySpaceCorrectness workload
jzhou77 Aug 10, 2022
93eb64f
Fix LocalRatekeeper workload
jzhou77 Aug 10, 2022
3fe1f97
Add a client knob GRV_ERROR_RETRY_DELAY
jzhou77 Aug 11, 2022
581819e
Fix attribute_not_found error in bulkSetup()
jzhou77 Aug 11, 2022
6a65f70
Increase waitForLowInFlight timeout
jzhou77 Aug 15, 2022
e253c19
Merge pull request #7860 from jzhou77/release-7.1
jzhou77 Aug 16, 2022
e9c25e5
Remove extremely spammy trace event by only logging the re-enabling o…
sfc-gh-satherton Aug 13, 2022
24e5f6e
Fix ErrorCommitInfo event parser
bnamasivayam Aug 15, 2022
c5fa155
Merge branch 'release-7.1' into cherry7653
dlambrig Aug 19, 2022
b3cded3
Merge pull request #7934 from jzhou77/release-7.1
jzhou77 Aug 22, 2022
ead4049
move global variables into function args/local variables, build both …
ammolitor Aug 23, 2022
af096aa
Merge branch 'release-7.1' into cherry7653
dlambrig Aug 24, 2022
167e1e6
Merge pull request #7666 from apple/cherry7653
jzhou77 Aug 25, 2022
c3e94e2
Fix missing localities for fdbserver
jzhou77 Aug 25, 2022
432bc89
Add more traces for load balancing
jzhou77 Aug 25, 2022
f99e20b
Suppress AllLocalAlternativesFailed events
jzhou77 Aug 26, 2022
5685f03
Merge pull request #7995 from jzhou77/release-7.1
jzhou77 Aug 26, 2022
53d37cb
Fix a race that check happened before last configure command
jzhou77 Aug 30, 2022
f0a2dd2
Merge branch 'release-7.1' into release-7.1
flowguru Aug 30, 2022
00098c7
Merge pull request #8048 from jzhou77/release-7.1
jzhou77 Aug 30, 2022
3636907
Add 7.1.20, 7.1.21 release notes
foundationdb-ci Aug 31, 2022
d0f15fe
disable AVX for 7.1.20 release
foundationdb-ci Aug 31, 2022
57ae31f
enable AVX and update version for 7.1.21 release
foundationdb-ci Aug 31, 2022
e790285
Merge pre-release '7.1.19' into ow-fork-7.1
1inker Sep 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else()
endif()

project(foundationdb
VERSION 7.1.19
VERSION 7.1.21
DESCRIPTION "FoundationDB is a scalable, fault-tolerant, ordered key-value store with full ACID transactions."
HOMEPAGE_URL "http://www.foundationdb.org/"
LANGUAGES C CXX ASM)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ def __init__(self, bb, protocol_version, full_output=True):
if protocol_version >= PROTOCOL_VERSION_6_3:
self.report_conflicting_keys = bb.get_bool()

if protocol_version >= PROTOCOL_VERSION_7_1:
lock_aware = bb.get_bool()
if bb.get_bool():
spanId = bb.get_bytes(16)


class UnsupportedProtocolVersionError(Exception):
def __init__(self, protocol_version):
super().__init__("Unsupported protocol version 0x%0.2X" % protocol_version)
Expand Down
31 changes: 27 additions & 4 deletions documentation/sphinx/source/release-notes/release-notes-710.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
.. _release-notes:

#############
Release Notes
#############

=======
7.1.21
======
* Same as 7.1.20 release with AVX enabled.

7.1.20
======
* Released with AVX disabled.
* Fixed missing localities for fdbserver that can cause cross DC calls among storage servers. `(PR #7995) <https://github.com/apple/foundationdb/pull/7995>`_
* Removed extremely spammy trace event in FetchKeys and fixed transaction_profiling_analyzer.py. `(PR #7934) <https://github.com/apple/foundationdb/pull/7934>`_
* Fixed bugs when GRV proxy returns an error. `(PR #7860) <https://github.com/apple/foundationdb/pull/7860>`_

7.1.19
======
* Same as 7.1.18 release with AVX enabled.

7.1.18
======
* Released with AVX disabled.
* Added knobs for the minimum and the maximum of the Ratekeeper's default priority. `(PR #7820) <https://github.com/apple/foundationdb/pull/7820>`_
* Fixed bugs in ``getRange`` of the special key space. `(PR #7778) <https://github.com/apple/foundationdb/pull/7778>`_, `(PR #7720) <https://github.com/apple/foundationdb/pull/7720>`_
* Added debug ID for secondary queries in index prefetching. `(PR #7755) <https://github.com/apple/foundationdb/pull/7755>`_
* Changed hostname resolving to prefer IPv6 addresses. `(PR #7750) <https://github.com/apple/foundationdb/pull/7750>`_
* Added more transaction debug events for prefetch queries. `(PR #7732) <https://github.com/apple/foundationdb/pull/7732>`_

7.1.17
======
* Same as 7.1.16 release with AVX enabled.
Expand All @@ -17,7 +40,7 @@ Release Notes
* Fixed ScopeEventFieldTypeMismatch error for TLogMetrics. `(PR #7640) <https://github.com/apple/foundationdb/pull/7640>`_
* Added getMappedRange latency metrics. `(PR #7632) <https://github.com/apple/foundationdb/pull/7632>`_
* Fixed a version vector performance bug due to not updating client side tag cache. `(PR #7616) <https://github.com/apple/foundationdb/pull/7616>`_
* Fixed DiskReadSeconds and DiskWriteSeconds calculaion in ProcessMetrics. `(PR #7609) <https://github.com/apple/foundationdb/pull/7609>`_
* Fixed DiskReadSeconds and DiskWriteSeconds calculation in ProcessMetrics. `(PR #7609) <https://github.com/apple/foundationdb/pull/7609>`_
* Added Rocksdb compression and data size stats. `(PR #7596) <https://github.com/apple/foundationdb/pull/7596>`_

7.1.15
Expand Down Expand Up @@ -76,7 +99,7 @@ Release Notes
* Added support of the reboot command in go bindings. `(PR #7270) <https://github.com/apple/foundationdb/pull/7270>`_
* Fixed several issues in profiling special keys using GlobalConfig. `(PR #7120) <https://github.com/apple/foundationdb/pull/7120>`_
* Fixed a stuck transaction system bug due to inconsistent recovery transaction version. `(PR #7261) <https://github.com/apple/foundationdb/pull/7261>`_
* Fixed a unknown_error crash due to not resolving hostnames. `(PR #7254) <https://github.com/apple/foundationdb/pull/7254>`_
* Fixed an unknown_error crash due to not resolving hostnames. `(PR #7254) <https://github.com/apple/foundationdb/pull/7254>`_
* Fixed a heap-use-after-free bug. `(PR #7250) <https://github.com/apple/foundationdb/pull/7250>`_
* Fixed a performance issue that remote TLogs are sending too many pops to log routers. `(PR #7235) <https://github.com/apple/foundationdb/pull/7235>`_
* Fixed an issue that SharedTLogs are not displaced and leaking disk space. `(PR #7246) <https://github.com/apple/foundationdb/pull/7246>`_
Expand Down
1 change: 1 addition & 0 deletions fdbclient/ClientKnobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void ClientKnobs::initialize(Randomize randomize) {

init( WRONG_SHARD_SERVER_DELAY, .01 ); if( randomize && BUGGIFY ) WRONG_SHARD_SERVER_DELAY = deterministicRandom()->random01(); // FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY; // SOMEDAY: This delay can limit performance of retrieving data when the cache is mostly wrong (e.g. dumping the database after a test)
init( FUTURE_VERSION_RETRY_DELAY, .01 ); if( randomize && BUGGIFY ) FUTURE_VERSION_RETRY_DELAY = deterministicRandom()->random01();// FLOW_KNOBS->PREVENT_FAST_SPIN_DELAY;
init( GRV_ERROR_RETRY_DELAY, 5.0 ); if( randomize && BUGGIFY ) GRV_ERROR_RETRY_DELAY = 0.01 + 5 * deterministicRandom()->random01();
init( UNKNOWN_TENANT_RETRY_DELAY, 0.0 ); if( randomize && BUGGIFY ) UNKNOWN_TENANT_RETRY_DELAY = deterministicRandom()->random01();
init( REPLY_BYTE_LIMIT, 80000 );
init( DEFAULT_BACKOFF, .01 ); if( randomize && BUGGIFY ) DEFAULT_BACKOFF = deterministicRandom()->random01();
Expand Down
1 change: 1 addition & 0 deletions fdbclient/ClientKnobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ClientKnobs : public KnobsImpl<ClientKnobs> {
double WRONG_SHARD_SERVER_DELAY; // SOMEDAY: This delay can limit performance of retrieving data when the cache is
// mostly wrong (e.g. dumping the database after a test)
double FUTURE_VERSION_RETRY_DELAY;
double GRV_ERROR_RETRY_DELAY;
double UNKNOWN_TENANT_RETRY_DELAY;
int REPLY_BYTE_LIMIT;
double DEFAULT_BACKOFF;
Expand Down
1 change: 1 addition & 0 deletions fdbclient/DatabaseContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ class DatabaseContext : public ReferenceCounted<DatabaseContext>, public FastAll
Counter transactionsExpensiveClearCostEstCount;
Counter transactionGrvFullBatches;
Counter transactionGrvTimedOutBatches;
Counter transactionCommitVersionNotFoundForSS;

ContinuousSample<double> latencies, readLatencies, commitLatencies, GRVLatencies, mutationsPerCommit,
bytesPerCommit, bgLatencies, bgGranulesPerRequest;
Expand Down
68 changes: 47 additions & 21 deletions fdbclient/NativeAPI.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void DatabaseContext::getLatestCommitVersions(const Reference<LocationInfo>& loc
return;
}

if (ssVersionVectorCache.getMaxVersion() != invalidVersion && readVersion > ssVersionVectorCache.getMaxVersion()) {
if (readVersion > ssVersionVectorCache.getMaxVersion()) {
if (!CLIENT_KNOBS->FORCE_GRV_CACHE_OFF && !info->options.skipGrvCache && info->options.useGrvCache) {
return;
} else {
Expand All @@ -253,16 +253,32 @@ void DatabaseContext::getLatestCommitVersions(const Reference<LocationInfo>& loc

std::map<Version, std::set<Tag>> versionMap; // order the versions to be returned
for (int i = 0; i < locationInfo->locations()->size(); i++) {
UID uid = locationInfo->locations()->getId(i);
if (ssidTagMapping.find(uid) != ssidTagMapping.end()) {
Tag tag = ssidTagMapping[uid];
bool updatedVersionMap = false;
Version commitVersion = invalidVersion;
Tag tag = invalidTag;
auto iter = ssidTagMapping.find(locationInfo->locations()->getId(i));
if (iter != ssidTagMapping.end()) {
tag = iter->second;
if (ssVersionVectorCache.hasVersion(tag)) {
Version commitVersion = ssVersionVectorCache.getVersion(tag); // latest commit version
commitVersion = ssVersionVectorCache.getVersion(tag); // latest commit version
if (commitVersion < readVersion) {
updatedVersionMap = true;
versionMap[commitVersion].insert(tag);
}
}
}
// do not log if commitVersion == readVersion as it is common.
if (!updatedVersionMap && commitVersion != readVersion) {
TraceEvent(SevDebug, "CommitVersionNotFoundForSS")
.detail("InSSIDMap", iter != ssidTagMapping.end() ? 1 : 0)
.detail("Tag", tag)
.detail("CommitVersion", commitVersion)
.detail("ReadVersion", readVersion)
.detail("VersionVector", ssVersionVectorCache.toString())
.setMaxEventLength(11000)
.setMaxFieldLength(10000);
++transactionCommitVersionNotFoundForSS;
}
}

// insert the commit versions in the version vector.
Expand Down Expand Up @@ -1445,13 +1461,13 @@ DatabaseContext::DatabaseContext(Reference<AsyncVar<Reference<IClusterConnection
transactionsProcessBehind("ProcessBehind", cc), transactionsThrottled("Throttled", cc),
transactionsExpensiveClearCostEstCount("ExpensiveClearCostEstCount", cc),
transactionGrvFullBatches("NumGrvFullBatches", cc), transactionGrvTimedOutBatches("NumGrvTimedOutBatches", cc),
latencies(1000), readLatencies(1000), commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000),
bytesPerCommit(1000), bgLatencies(1000), bgGranulesPerRequest(1000), outstandingWatches(0), sharedStatePtr(nullptr),
lastGrvTime(0.0), cachedReadVersion(0), lastRkBatchThrottleTime(0.0), lastRkDefaultThrottleTime(0.0),
lastProxyRequestTime(0.0), transactionTracingSample(false), taskID(taskID), clientInfo(clientInfo),
clientInfoMonitor(clientInfoMonitor), coordinator(coordinator), apiVersion(apiVersion), mvCacheInsertLocation(0),
healthMetricsLastUpdated(0), detailedHealthMetricsLastUpdated(0),
smoothMidShardSize(CLIENT_KNOBS->SHARD_STAT_SMOOTH_AMOUNT),
transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), latencies(1000), readLatencies(1000),
commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), bgLatencies(1000),
bgGranulesPerRequest(1000), outstandingWatches(0), sharedStatePtr(nullptr), lastGrvTime(0.0), cachedReadVersion(0),
lastRkBatchThrottleTime(0.0), lastRkDefaultThrottleTime(0.0), lastProxyRequestTime(0.0),
transactionTracingSample(false), taskID(taskID), clientInfo(clientInfo), clientInfoMonitor(clientInfoMonitor),
coordinator(coordinator), apiVersion(apiVersion), mvCacheInsertLocation(0), healthMetricsLastUpdated(0),
detailedHealthMetricsLastUpdated(0), smoothMidShardSize(CLIENT_KNOBS->SHARD_STAT_SMOOTH_AMOUNT),
specialKeySpace(std::make_unique<SpecialKeySpace>(specialKeys.begin, specialKeys.end, /* test */ false)),
connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) {

Expand Down Expand Up @@ -1723,8 +1739,9 @@ DatabaseContext::DatabaseContext(const Error& err)
transactionsProcessBehind("ProcessBehind", cc), transactionsThrottled("Throttled", cc),
transactionsExpensiveClearCostEstCount("ExpensiveClearCostEstCount", cc),
transactionGrvFullBatches("NumGrvFullBatches", cc), transactionGrvTimedOutBatches("NumGrvTimedOutBatches", cc),
latencies(1000), readLatencies(1000), commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000),
bytesPerCommit(1000), bgLatencies(1000), bgGranulesPerRequest(1000), transactionTracingSample(false),
transactionCommitVersionNotFoundForSS("CommitVersionNotFoundForSS", cc), latencies(1000), readLatencies(1000),
commitLatencies(1000), GRVLatencies(1000), mutationsPerCommit(1000), bytesPerCommit(1000), bgLatencies(1000),
bgGranulesPerRequest(1000), transactionTracingSample(false),
smoothMidShardSize(CLIENT_KNOBS->SHARD_STAT_SMOOTH_AMOUNT),
connectToDatabaseEventCacheHolder(format("ConnectToDatabase/%s", dbId.toString().c_str())) {}

Expand Down Expand Up @@ -3460,8 +3477,8 @@ ACTOR Future<Key> getKey(Reference<TransactionState> trState,

ACTOR Future<Version> waitForCommittedVersion(Database cx, Version version, SpanID spanContext) {
state Span span("NAPI:waitForCommittedVersion"_loc, { spanContext });
try {
loop {
loop {
try {
choose {
when(wait(cx->onProxiesChanged())) {}
when(GetReadVersionReply v = wait(basicLoadBalance(
Expand All @@ -3487,10 +3504,16 @@ ACTOR Future<Version> waitForCommittedVersion(Database cx, Version version, Span
wait(delay(CLIENT_KNOBS->FUTURE_VERSION_RETRY_DELAY, cx->taskID));
}
}
} catch (Error& e) {
if (e.code() == error_code_batch_transaction_throttled ||
e.code() == error_code_proxy_memory_limit_exceeded) {
// GRV Proxy returns an error
wait(delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY));
} else {
TraceEvent(SevError, "WaitForCommittedVersionError").error(e);
throw;
}
}
} catch (Error& e) {
TraceEvent(SevError, "WaitForCommittedVersionError").error(e);
throw;
}
}

Expand Down Expand Up @@ -6632,9 +6655,12 @@ ACTOR Future<GetReadVersionReply> getConsistentReadVersion(SpanID parentSpan,
}
}
} catch (Error& e) {
if (e.code() != error_code_broken_promise && e.code() != error_code_batch_transaction_throttled)
if (e.code() != error_code_broken_promise && e.code() != error_code_batch_transaction_throttled &&
e.code() != error_code_proxy_memory_limit_exceeded)
TraceEvent(SevError, "GetConsistentReadVersionError").error(e);
if (e.code() == error_code_batch_transaction_throttled && !cx->apiVersionAtLeast(630)) {
if ((e.code() == error_code_batch_transaction_throttled ||
e.code() == error_code_proxy_memory_limit_exceeded) &&
!cx->apiVersionAtLeast(630)) {
wait(delayJittered(5.0));
} else {
throw;
Expand Down
33 changes: 33 additions & 0 deletions fdbrpc/LoadBalance.actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,12 @@ Future<REPLY_TYPE(Request)> loadBalance(
// server count is within "LOAD_BALANCE_MAX_BAD_OPTIONS". We
// do not need to consider any remote servers.
break;
} else if (badServers == alternatives->countBest() && i == badServers) {
TraceEvent("AllLocalAlternativesFailed")
.suppressFor(1.0)
.detail("Alternatives", alternatives->description())
.detail("Total", alternatives->size())
.detail("Best", alternatives->countBest());
}

RequestStream<Request> const* thisStream = &alternatives->get(i, channel);
Expand Down Expand Up @@ -587,6 +593,7 @@ Future<REPLY_TYPE(Request)> loadBalance(
// nextAlt. This logic matters only if model == nullptr. Otherwise, the
// bestAlt and nextAlt have been decided.
state RequestStream<Request> const* stream = nullptr;
state LBDistance::Type distance;
for (int alternativeNum = 0; alternativeNum < alternatives->size(); alternativeNum++) {
int useAlt = nextAlt;
if (nextAlt == startAlt)
Expand All @@ -595,13 +602,15 @@ Future<REPLY_TYPE(Request)> loadBalance(
useAlt = (nextAlt + alternatives->size() - 1) % alternatives->size();

stream = &alternatives->get(useAlt, channel);
distance = alternatives->getDistance(useAlt);
if (!IFailureMonitor::failureMonitor().getState(stream->getEndpoint()).failed &&
(!firstRequestEndpoint.present() || stream->getEndpoint().token.first() != firstRequestEndpoint.get()))
break;
nextAlt = (nextAlt + 1) % alternatives->size();
if (nextAlt == startAlt)
triedAllOptions = TriedAllOptions::True;
stream = nullptr;
distance = LBDistance::DISTANT;
}

if (!stream && !firstRequestData.isValid()) {
Expand Down Expand Up @@ -637,6 +646,18 @@ Future<REPLY_TYPE(Request)> loadBalance(
firstRequestEndpoint = Optional<uint64_t>();
} else if (firstRequestData.isValid()) {
// Issue a second request, the first one is taking a long time.
if (distance == LBDistance::DISTANT) {
TraceEvent("LBDistant2nd")
.suppressFor(0.1)
.detail("Distance", (int)distance)
.detail("BackOff", backoff)
.detail("TriedAllOptions", triedAllOptions)
.detail("Alternatives", alternatives->description())
.detail("Token", stream->getEndpoint().token)
.detail("Total", alternatives->size())
.detail("Best", alternatives->countBest())
.detail("Attempts", numAttempts);
}
secondRequestData.startRequest(backoff, triedAllOptions, stream, request, model, alternatives, channel);
state bool firstFinished = false;

Expand Down Expand Up @@ -666,6 +687,18 @@ Future<REPLY_TYPE(Request)> loadBalance(
}
} else {
// Issue a request, if it takes too long to get a reply, go around the loop
if (distance == LBDistance::DISTANT) {
TraceEvent("LBDistant")
.suppressFor(0.1)
.detail("Distance", (int)distance)
.detail("BackOff", backoff)
.detail("TriedAllOptions", triedAllOptions)
.detail("Alternatives", alternatives->description())
.detail("Token", stream->getEndpoint().token)
.detail("Total", alternatives->size())
.detail("Best", alternatives->countBest())
.detail("Attempts", numAttempts);
}
firstRequestData.startRequest(backoff, triedAllOptions, stream, request, model, alternatives, channel);
firstRequestEndpoint = stream->getEndpoint().token.first();

Expand Down
1 change: 1 addition & 0 deletions fdbrpc/MultiInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class MultiInterface<ReferencedInterface<T>> : public ReferenceCounted<MultiInte
}

T const& getInterface(int index) { return alternatives[index]->interf; }
LBDistance::Type getDistance(int index) const { return (LBDistance::Type)alternatives[index]->distance; }
UID getId(int index) const { return alternatives[index]->interf.id(); }
bool hasInterface(UID id) const {
for (const auto& ref : alternatives) {
Expand Down
38 changes: 24 additions & 14 deletions fdbserver/BackupWorker.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,30 @@ struct BackupData {
ACTOR static Future<Version> _getMinKnownCommittedVersion(BackupData* self) {
state Span span("BA:GetMinCommittedVersion"_loc);
loop {
GetReadVersionRequest request(span.context,
0,
TransactionPriority::DEFAULT,
invalidVersion,
GetReadVersionRequest::FLAG_USE_MIN_KNOWN_COMMITTED_VERSION);
choose {
when(wait(self->cx->onProxiesChanged())) {}
when(GetReadVersionReply reply =
wait(basicLoadBalance(self->cx->getGrvProxies(UseProvisionalProxies::False),
&GrvProxyInterface::getConsistentReadVersion,
request,
self->cx->taskID))) {
self->cx->ssVersionVectorCache.applyDelta(reply.ssVersionVectorDelta);
return reply.version;
try {
GetReadVersionRequest request(span.context,
0,
TransactionPriority::DEFAULT,
invalidVersion,
GetReadVersionRequest::FLAG_USE_MIN_KNOWN_COMMITTED_VERSION);
choose {
when(wait(self->cx->onProxiesChanged())) {}
when(GetReadVersionReply reply =
wait(basicLoadBalance(self->cx->getGrvProxies(UseProvisionalProxies::False),
&GrvProxyInterface::getConsistentReadVersion,
request,
self->cx->taskID))) {
self->cx->ssVersionVectorCache.applyDelta(reply.ssVersionVectorDelta);
return reply.version;
}
}
} catch (Error& e) {
if (e.code() == error_code_batch_transaction_throttled ||
e.code() == error_code_proxy_memory_limit_exceeded) {
// GRV Proxy returns an error
wait(delayJittered(CLIENT_KNOBS->GRV_ERROR_RETRY_DELAY));
} else {
throw;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion fdbserver/GrvProxyServer.actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "fdbserver/WaitFailure.h"
#include "fdbserver/WorkerInterface.actor.h"
#include "fdbrpc/sim_validation.h"
#include "flow/IRandom.h"
#include "flow/flow.h"
#include "flow/actorcompiler.h" // This must be the last #include.

Expand Down Expand Up @@ -425,7 +426,9 @@ ACTOR Future<Void> queueGetReadVersionRequests(Reference<AsyncVar<ServerDBInfo>
// WARNING: this code is run at a high priority, so it needs to do as little work as possible
bool canBeQueued = true;
if (stats->txnRequestIn.getValue() - stats->txnRequestOut.getValue() >
SERVER_KNOBS->START_TRANSACTION_MAX_QUEUE_SIZE) {
SERVER_KNOBS->START_TRANSACTION_MAX_QUEUE_SIZE ||
(g_network->isSimulated() && !g_simulator.speedUpSimulation &&
deterministicRandom()->random01() < 0.01)) {
// When the limit is hit, try to drop requests from the lower priority queues.
if (req.priority == TransactionPriority::BATCH) {
canBeQueued = false;
Expand Down
Loading