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

Method refresh

fdbclient/GlobalConfig.actor.cpp:158–178  ·  view source on GitHub ↗

Updates local copy of global configuration by reading the entire key-range from storage (proxied through the GrvProxies).

Source from the content-addressed store, hash-verified

156// Updates local copy of global configuration by reading the entire key-range
157// from storage (proxied through the GrvProxies).
158ACTOR Future<Void> GlobalConfig::refresh(GlobalConfig* self, Version lastKnown) {
159 // TraceEvent trace(SevInfo, "GlobalConfigRefresh");
160 self->erase(KeyRangeRef(""_sr, "\xff"_sr));
161
162 state Backoff backoff(CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_BACKOFF, CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_MAX_BACKOFF);
163 loop {
164 try {
165 GlobalConfigRefreshReply reply =
166 wait(timeoutError(basicLoadBalance(self->cx->getGrvProxies(UseProvisionalProxies::False),
167 &GrvProxyInterface::refreshGlobalConfig,
168 GlobalConfigRefreshRequest{ lastKnown }),
169 CLIENT_KNOBS->GLOBAL_CONFIG_REFRESH_TIMEOUT));
170 for (const auto& kv : reply.result) {
171 KeyRef systemKey = kv.key.removePrefix(globalConfigKeysPrefix);
172 self->insert(systemKey, kv.value);
173 }
174 return Void();
175 } catch (Error& e) {
176 wait(backoff.onError());
177 }
178 }
179}
180
181// Applies updates to the local copy of the global configuration when this

Callers 1

Calls 6

timeoutErrorFunction · 0.85
getGrvProxiesMethod · 0.80
KeyRangeRefClass · 0.50
eraseMethod · 0.45
insertMethod · 0.45
removePrefixMethod · 0.45

Tested by

no test coverage detected