Repository navigation
Persist tenant deletion and recover startup safely - #7
Merged
Merged
Conversation
Signed-off-by: theboringhumane <me@iamharsh.dev>
Signed-off-by: theboringhumane <me@iamharsh.dev>
Signed-off-by: theboringhumane <me@iamharsh.dev>
Signed-off-by: theboringhumane <me@iamharsh.dev>
theboringhumane
marked this pull request as ready for review
October 10, 2026 11:55
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.
Deleting a tenant left its PostgreSQL record behind, so the next startup tried to restore ClickHouse access for a deleted user and failed. Persist deletion intent and key revocation before removing access, retain inactive history, and reconcile interrupted cleanup during startup.
Tenant lifecycle changes now use a PostgreSQL advisory lock across instances. Provisioning reserves a unique database username and records confirmed creation before grants; ambiguous creation stops for operator review. A maintenance command repairs reviewed legacy deletions from a protected exact tenant allowlist without inferring ownership from revoked keys.
Validation: mandatory CI adds real PostgreSQL and ClickHouse lifecycle, restart, reprovisioning, migration replay, collision, locking and recovery checks. Unit tests cover failed boundaries and allowlist validation. Local work was limited to source review and formatting; runtime recovery and restart qualification remain pending. Authentication caches can retain a valid key for up to 60 seconds.
Refs #6. Keep this issue open until the rebuilt image passes recovery and restart acceptance.