sql-150: Create test suite for durable temporary objects - #38159
Open
SangJunBak wants to merge 3 commits into
Open
sql-150: Create test suite for durable temporary objects#38159SangJunBak wants to merge 3 commits into
SangJunBak wants to merge 3 commits into
Conversation
Temporary items are durable items tagged with the UUID of the session that created them. Neither of the two mechanisms holding that together had any coverage. read-write: name uniqueness is scoped by the owning session, so two sessions can each hold a 'tt' in the sentinel temporary schema while one session cannot hold it twice. remove_ephemeral_items then reclaims all of them and leaves normal items alone, which matters because an over-broad filter there would silently delete real user items. open: a writable open reclaims a temporary item left behind by a process that died without closing its session, which is the only thing between a kill -9 and a permanently leaked catalog item. A read-only open must not, since a zero-downtime follower reads the leader's catalog while the leader's sessions are still live and still own theirs. The read-only case is checked before the writable one, so the ordering makes both directions observable.
Temporary tables and views are durable catalog items tagged with their owning session, so they need cleanup on both paths out of a session, and neither path had a test. The only existing temp-teardown coverage is DISCARD TEMP / DISCARD ALL, which is a different code path.
Ensure creating temporary items during a 0dt upgrade doesn't cause a halt. This is already the case because even though these temporary objects are public to all envds, we clear them from the snapshot whenever we open the catalog not in readonly mode.
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.
Creates a more in-depth test suite for implementation, included unit tests at the persist level and e2e tests at the mzcompose level to replicate killing a process
Motivation
sql-150
Description
catalog: test ephemeral item reclamation in the durable layer
Temporary items are durable items tagged with the UUID of the session that created them. Neither of the two mechanisms holding that together had any coverage.
ttin the sentinel temporary schema while one session cannot hold it twice.remove_ephemeral_itemsthen reclaims all of them and leaves normal items alone, which matters because an over-broad filter there would silently delete real user items.kill -9and a permanently leaked catalog item. A read-only open must not, since a zero-downtime follower reads the leader's catalog while the leader's sessions are still live and still own theirs. The read-only case is checked before the writable one, so the ordering makes both directions observable.test: cover temporary item cleanup on session close and kill -9
Temporary tables and views are durable catalog items tagged with their owning session, so they need cleanup on both paths out of a session, and neither path had a test. The only existing temp-teardown coverage is
DISCARD TEMP/DISCARD ALL, which is a different code path.test: cover 0dt preflight behavior for temporary items
Ensure creating temporary items during a 0dt upgrade doesn't cause a halt. This is already the case because even though these temporary objects are public to all envds, we clear them from the snapshot whenever we open the catalog not in readonly mode.