Skip to content

remote: Vote when adding and removing remotes

Patrick Steinhardt requested to merge pks-remotes-voting into master

The AddRemote() and RemoveRemote() RPCs are currently the only ones which don't cast transactional votes in production. As a result, all secondaries are always considered as outdated whenever we for example update object pools or mirrors. Given that these RPCs are typically executed before these long running actions, the net result is that secondaries will be out of date most of the time.

Fix the issue by adding transactional voting for AddRemote() and RemoveRemote(). In both cases, voting is done on the remote configuration only, and not on the complete configuration. This may be inaccurate as the remote may be influenced by other configuration like for example the http.<url>. config entries. But given that we do not synchronize configuration on replication, it may be risky to instead vote on the complete configuration as it may have diverged across nodes and would never recover even after a replication job got processed.

Given that these RPCs are about to be phased out soonish anyway, we just ignore this issue for now. At least for a subset of fetches, this change will likely not yet enable transactional behaviour. Instead, we may see a shift to missing votes in SetConfig(), which is used to set up credentials. We can fix this issue in a follow-up though, especially so because at that time we'll also need to have replication of the config to recover from failed votes.

Merge request reports

Loading