Repository navigation
Keep a replaced zone readable through a late settle - #381
Merged
Merged
Conversation
Committing or discarding a zone whose staging entry is gone, and whose generation no header names any more, dropped that generation at once, taking it for one that was dropped before it was ever published. It can also be one that was published and replaced since, by a later commit or by a delete, whose drop is already scheduled for the end of the grace period because queries that read its header may still be resolving against it. A late discard or commit of it deleted its records under those queries, which then got NXDOMAIN, the answer the grace period is there to prevent. Only a caller that takes a generation's staging entry knows that nothing has published it, so only that caller drops it at once. When the entry is already gone, the generation is dropped once the grace period has passed, as a replaced one is, which also drops whatever was written into a dropped one since.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #377. When
commit_zone/1ordiscard_zone/1gets a zone whose staging entry is gone and whose generation no header names any more, it dropped that generation at once, taking it for one that was dropped before it was ever published. It can also be one that was published and then replaced, by a later commit or bydelete_zone/1, whose drop is already scheduled for the end of the grace period because queries that read its header may still be resolving against it, for example while a pipeline stage waits on an upstream lookup. A late discard or commit deleted its records under those queries, which then got NXDOMAIN, the answer the grace period is there to prevent.Return values are unchanged: committing a zone that was replaced since it was published already returned
{error, not_staged}, and its documentation now says so. Discarding or committing a zone that is still live is still a no-op.🔍 QA
Scenario: a late settle of a replaced zone leaves it readable
rebar3 ct --suite=test/zones_SUITE --group=cache.replaced_zone_outlives_a_late_settleto pass: after one zone replaces another and a second is deleted, discarding and committing each of them again leaves both resolving through their headers. Against v12.0.0 the replaced one answers NXDOMAIN.Scenario: a dropped staged zone still loses what was written into it
staged_zone_is_dropped_with_its_ownerto pass: records written into a zone dropped with its owner are gone once the grace period has passed.📋 Deployment Pre/Post tasks
make testpasses.