sql-150: Create test suite for durable temporary objects - #38159
Merged
Conversation
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 13, 2026 01:35
75ed78e to
fdbfc0e
Compare
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 13, 2026 15:19
fdbfc0e to
536c534
Compare
mtabebe
approved these changes
Aug 13, 2026
mtabebe
left a comment
Contributor
There was a problem hiding this comment.
Thank you for the tests 🫡
stack merge was automatically disabled
August 13, 2026 21:08
Pull Request is not mergeable
stack merge was automatically disabled
August 13, 2026 21:16
Pull Request is not mergeable
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 14, 2026 16:07
536c534 to
61c1367
Compare
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
2 times, most recently
from
August 17, 2026 17:58
450068c to
de28215
Compare
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 17, 2026 19:35
de28215 to
30f8ef7
Compare
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 19, 2026 19:00
30f8ef7 to
de0a1f8
Compare
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.
SangJunBak
force-pushed
the
jun/move-temp-to-catalog-split-3
branch
from
August 19, 2026 20:34
de0a1f8 to
75f805c
Compare
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.