Skip to content

Keep membership and load state consistent after removal - #33

Open
vitalivo wants to merge 1 commit into
buraksezer:masterfrom
vitalivo:fix/membership-bookkeeping
Open

vitalivo wants to merge 1 commit into
buraksezer:masterfrom
vitalivo:fix/membership-bookkeeping

Conversation

@vitalivo

Copy link
Copy Markdown

Repeated names passed to New currently add duplicate hashes even though membership is stored by name. Removing that member leaves stale hashes and can panic during partition redistribution. Ignore existing members in the internal insertion path, as Add already does.

Also clear the load distribution when the last member is removed; otherwise LoadDistribution continues reporting a departed member after the ring becomes empty.

Both regressions fail before the fix. Full go test -race -cover ./... passes (96.2% coverage), along with go vet ./.... Tests cover partition ownership after duplicate removal and removal/repopulation of the final member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant