Updates local copy of global configuration by reading the entire key-range from storage (proxied through the GrvProxies).
| 156 | // Updates local copy of global configuration by reading the entire key-range |
| 157 | // from storage (proxied through the GrvProxies). |
| 158 | ACTOR 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 |
no test coverage detected