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

Method updateSupportedVersions

fdbclient/MultiVersionTransaction.actor.cpp:2718–2740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2716}
2717
2718void MultiVersionApi::updateSupportedVersions() {
2719 if (networkSetup) {
2720 Standalone<VectorRef<uint8_t>> versionStr;
2721
2722 // not mutating the client, so just call on one instance of each client version.
2723 // thread 0 always exists.
2724 runOnExternalClients(0, [&versionStr](Reference<ClientInfo> client) {
2725 const char* ver = client->api->getClientVersion();
2726 versionStr.append(versionStr.arena(), (uint8_t*)ver, (int)strlen(ver));
2727 versionStr.append(versionStr.arena(), (uint8_t*)";", 1);
2728 });
2729
2730 if (!localClient->failed) {
2731 const char* local = localClient->api->getClientVersion();
2732 versionStr.append(versionStr.arena(), (uint8_t*)local, (int)strlen(local));
2733 } else {
2734 versionStr.resize(versionStr.arena(), std::max(0, versionStr.size() - 1));
2735 }
2736
2737 setNetworkOption(FDBNetworkOptions::SUPPORTED_CLIENT_VERSIONS,
2738 StringRef(versionStr.begin(), versionStr.size()));
2739 }
2740}
2741
2742// Must be called from the main thread
2743ACTOR Future<std::string> updateClusterSharedStateMapImpl(MultiVersionApi* self,

Callers 3

addClientMethod · 0.80
updateDatabaseMethod · 0.80

Calls 7

setNetworkOptionFunction · 0.85
StringRefClass · 0.50
getClientVersionMethod · 0.45
appendMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected