consul
consul copied to clipboard
Set replication metric to 0 when losing leadership
Fixes https://github.com/hashicorp/consul/issues/11377#issuecomment-966107284
When the leader changes the replication metrics on the old leader (now follower) keeps reporting 1. This PR fixes that issue.
This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions.
Hi there. There's one other place that needs a similar change to fixup the rest of the replicators (like for config entries). For historical reasons there are two versions of the replicators, the ACL ones and the common plumbing for the rest. You fixed the former in this PR so far and the other is in this area: https://github.com/hashicorp/consul/blob/main/agent/consul/replication.go#L156
You can see the pairing of status/index normally being set down here https://github.com/hashicorp/consul/blob/main/agent/consul/leader.go#L797 so you'll just have to repeat the fix in this one place and it should be good.
Hi @rboyer, I made the change you suggested.