streaming: re-establish the genesis lifecycle after Redis state loss - #84
Merged
Conversation
A bound generation-one handle on the flat key observing a wholly absent lifecycle record is state loss, not destruction: intentional Destroy leaves a tombstone. The genesis identity is the one incarnation that can prove continuity — the flat key is generation one by construction, so every concurrent re-establishment converges on the identical record — so verification, publication, and consumer-group recovery now atomically re-assert it and retry once. Later generations still cannot prove continuity and remain destroyed, as do tombstoned generations. This restores no-restart recovery from full Redis state loss for long-running publishers and sinks.
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.
Under v1.10.0 a bound handle observing a wholly absent lifecycle record treated it as destruction, so recovering from full Redis state loss (FLUSHDB, restore from empty) required restarting every long-running publisher and sink — a regression against the recovery property v1.9.0 shipped. Absence is distinguishable from intent:
Destroyleaves a terminal tombstone.This change lets exactly one identity re-assert a lost record: a bound generation-one handle on the flat physical key. The flat key is generation one by construction, so every concurrent re-establishment converges on the identical record, and the retried operation's own fence decides against a racing tombstone. Later generations cannot prove continuity and remain destroyed. Verification, publication, and sink consumer-group recovery heal-and-retry once through this path.
Tests:
TestGenesisLifecycleReestablishedAfterStateLoss(publisher and sink resume after FLUSHDB with no new handles) andTestDestroyedGenesisStaysTerminal(tombstones stay terminal). Full repo-racesuite green against live Redis. Found by goa-ai's state-loss integration suite when bumping it to v1.10.0.