MCPcopy Create free account
hub / github.com/apple/foundationdb / excludeServers

Function excludeServers

fdbclient/ManagementAPI.actor.cpp:1320–1337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1318}
1319
1320void excludeServers(Transaction& tr, std::vector<AddressExclusion>& servers, bool failed) {
1321 tr.setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
1322 tr.setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE);
1323 tr.setOption(FDBTransactionOptions::LOCK_AWARE);
1324 tr.setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES);
1325 std::string excludeVersionKey = deterministicRandom()->randomUniqueID().toString();
1326 auto serversVersionKey = failed ? failedServersVersionKey : excludedServersVersionKey;
1327 tr.addReadConflictRange(singleKeyRange(serversVersionKey)); // To conflict with parallel includeServers
1328 tr.set(serversVersionKey, excludeVersionKey);
1329 for (auto& s : servers) {
1330 if (failed) {
1331 tr.set(encodeFailedServersKey(s), StringRef());
1332 } else {
1333 tr.set(encodeExcludedServersKey(s), StringRef());
1334 }
1335 }
1336 TraceEvent("ExcludeServersCommit").detail("Servers", describe(servers)).detail("ExcludeFailed", failed);
1337}
1338
1339ACTOR Future<Void> excludeServers(Database cx, std::vector<AddressExclusion> servers, bool failed) {
1340 if (cx->apiVersionAtLeast(700)) {

Callers 6

_startMethod · 0.85
Future<Void> excludeFunction · 0.85
ifMethod · 0.85

Calls 13

deterministicRandomFunction · 0.85
singleKeyRangeFunction · 0.85
encodeFailedServersKeyFunction · 0.85
encodeExcludedServersKeyFunction · 0.85
TraceEventClass · 0.85
randomUniqueIDMethod · 0.80
detailMethod · 0.80
describeFunction · 0.70
setOptionMethod · 0.65
addReadConflictRangeMethod · 0.65
setMethod · 0.65
StringRefClass · 0.50

Tested by 1