Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memberlist: Aggressive scale down can cause lost tombstones #44

Open
stevesg opened this issue Jul 30, 2021 · 0 comments
Open

Memberlist: Aggressive scale down can cause lost tombstones #44

stevesg opened this issue Jul 30, 2021 · 0 comments

Comments

@stevesg
Copy link
Contributor

stevesg commented Jul 30, 2021

Describe the bug
When scaling down extremely fast, a tombstone can still go missing. The TestSingleBinaryWithMemberlistScaling can reproduce this on occasion with the default values. e.g.

integration_memberlist_single_binary_test.go:212: cortex-1: cortex_ring_members=4.000000 memberlist_client_kv_store_value_tombstones=16.000000

memberlist-tombstone-with-debug.log

What appears to be happening is that the final messages from the instance being scaled down are being sent the expected number of times, but the intended recipients are also shutting down. This is not trivial to fix because we do not get any feedback from memberlist as to whether our messages were actually received. Possible solutions:

  • Somehow monitor for failed sends and re-send until some number of successful sends are achieved
  • Send out messages tombstones more times (e.g. a form of retransmit multiplier specifically for tombstones)

To Reproduce
Run the TestSingleBinaryWithMemberlistScaling a few times.

make ./cmd/cortex/.uptodate
go test -timeout=1h -count=20 -v -tags=requires_docker ./integration -run "^TestSingleBinaryWithMemberlistScaling$"

Tweaking the scaling numbers in the test make it fail more often:

maxCortex := 8
minCortex := 1

Expected behavior
The test doesn't fail.

Environment:

  • Infrastructure: N/A
  • Deployment tool: N/A

Additional Context

(Origin: cortexproject/cortex#4360)

stevesg added a commit that referenced this issue Jul 30, 2021
The original fix was to check `memberlist_client_cluster_members_count`
to only scale down the next instance once the previous has been removed
everywhere. However, this does not inhibit the test enough to ensure
that tombstones are not lost, because the memberlist membership
propagates much quicker than ring membership. Therefore, instead wait
until every instance has seen the tombstone before removing another
instance.

This unfortunately takes the teeth out the test so the alternative is
to skip it or remove the test entirely, until issue #44 is fixed.
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

No branches or pull requests

1 participant