Skip to content
New issue

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

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

Already on GitHub? # to your account

consumer: shard transitions account for delete-then-create race #315

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

jgraettinger
Copy link
Contributor

@jgraettinger jgraettinger commented Feb 2, 2022

If a shard assignment is removed (for example, because its FAILED)
and is then immediately re-created by the allocation coordinator,
we previously could fail to notice that the prior local shard was
invalidated and should be re-created.

Account for this by additionally monitoring the CreateRevision of
assignments and treating an assignment of the same or higher slot,
with a differing CreateRevision, as being a novel assignment which
requires a novel local shard to be boot-strapped.

Fixes #314


This change is Reviewable

If a shard assignment is removed (for example, because its FAILED)
and is then immediately re-created by the allocation coordinator,
we previously could fail to notice that the prior local shard was
invalidated and should be re-created.

Account for this by additionally monitoring the CreateRevision of
assignments and treating an assignment of the same or higher slot,
with a differing CreateRevision, as being a novel assignment which
requires a novel local shard to be boot-strapped.

Fixes #314
@jgraettinger jgraettinger requested a review from saterus February 2, 2022 19:33
Comment on lines +292 to +293
} else if p.Raw.CreateRevision == asn.Raw.CreateRevision {
// Assignment value was updated but the assignment itself is unchanged.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this case. How would the assignment value be updated without creating a new revision?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the etcd spec. CreateRevision is separately tracked from ModRevision.

@jgraettinger jgraettinger merged commit 0087160 into master Feb 2, 2022
@jgraettinger jgraettinger deleted the johnny/shard-aba branch February 2, 2022 23:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consumer: ABA concurrency between shard watchdog & transition handler
2 participants