feat(cluster): undo-block resource identity + owner-as-master routing#23
Open
sqlrush wants to merge 1 commit into
Open
feat(cluster): undo-block resource identity + owner-as-master routing#23sqlrush wants to merge 1 commit into
sqlrush wants to merge 1 commit into
Conversation
Name an undo block (including the segment TT header block) as a first-class cluster resource: (owner_node, undo_segment, block_no, generation) encoded into the 16-byte ClusterResId wire format as class 0xF9. Undo is the first owner-as-master resid class: the resource master IS the owning instance (cluster_undo_resid_master), never a GRD shard-hash node. The GRD hash-master lookup now fails closed (Assert + new SQLSTATE 53R9Q) if an undo resid reaches it, and the generation predicate (segment wrap_count) lets callers fail closed on recycled-segment stale references. Pure identity layer only: no grant/PI/serving data plane, no write path change, no on-disk format or wire ABI change (ClusterResId stays 16 bytes; new class byte value only). - new cluster_undo_resid.h: class byte 0xF9 + collision StaticAssert net (9 header-visible classes + LOCKTAG_LAST_TYPE) + field mapping - new cluster_undo_resid.c: encode/decode/is_undo/master/ generation_matches pure layer (standalone-linkable) - cluster_grd.c: fail-closed undo-class guard at cluster_grd_lookup_master entry - errcodes.txt: 53R9Q ERRCODE_CLUSTER_UNDO_RESID_HASH_ROUTED - tests: test_cluster_undo_resid (8 cases: round-trip, class byte, discriminator, 16B wire lock, owner bounds, owner-as-master, generation); guard-fire leg in test_cluster_grd via an ereport trampoline; t/006 SQLSTATE spot-check line Spec: spec-5.22a-undo-block-resource-identity.md
6 tasks
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.
Summary
(owner_node, undo_segment, block_no, generation)encoded into the 16-byteClusterResIdwire format as new class byte0xF9.cluster_undo_resid_master()returns the encoded owner directly — never a GRD shard-hash node. The GRD hash-master lookup fails closed (Assert+ new SQLSTATE53R9Q) if an undo resid reaches it.cluster_undo_resid_generation_matches()(generation = segment reuse wrap_count); mismatch means a stale reference and callers must fail closed.ClusterResIdstays 16 bytes).Files
src/include/cluster/cluster_undo_resid.h— class byte + collision StaticAssert net (9 header-visible classes +LOCKTAG_LAST_TYPE) + field mappingsrc/backend/cluster/cluster_undo_resid.c— encode/decode/is_undo/master/generation_matches (standalone-linkable pure layer)src/backend/cluster/cluster_grd.c— fail-closed undo-class guard atcluster_grd_lookup_masterentrysrc/backend/utils/errcodes.txt—53R9Q ERRCODE_CLUSTER_UNDO_RESID_HASH_ROUTEDtest_cluster_undo_resid(8 cases), guard-fire leg intest_cluster_grd(ereport trampoline), t/006 SQLSTATE spot-checkTest plan
Spec: spec-5.22a-undo-block-resource-identity.md