Skip to content

executor: give a partitioned table to attach the parent's indexes - #713

Open
Kiran01bm wants to merge 2 commits into
kiran01bm/attach-partitioned-defaultfrom
kiran01bm/attach-partitioned-indexes
Open

Kiran01bm wants to merge 2 commits into
kiran01bm/attach-partitioned-defaultfrom
kiran01bm/attach-partitioned-indexes

Conversation

@Kiran01bm

Copy link
Copy Markdown
Collaborator

The online attach's index step now gives a table that is itself partitioned the parent's indexes, built concurrently, so the attach of such a table builds no index.

Why

When pg-sprite attaches a partition online, it first gives the new table every index of the parent, built concurrently while writes go on, because the ATTACH would otherwise build them while it blocks the table. For a table that is itself partitioned, the ATTACH looks for a valid partitioned index on that table to pair with each parent index. If it finds none, it builds the index on every partition of the table, all under ACCESS EXCLUSIVE. Until now the index step refused a partitioned table outright. This PR gives it those indexes ahead of time, one step closer to attaching a sub-partitioned table online. The attach flow still refuses one until the foreign key step follows.

What

  • For each parent index that backs no constraint and that nothing on the table pairs with, the step runs the existing partitioned index build on the table itself, under the derived name <index>_p<table oid>. The build creates the table's index ON ONLY, builds every leaf's index concurrently, attaches each level bottom up, and returns once the table's index is valid. A rerun resumes an index a stop left invalid.
  • The pairing reads a partitioned table's own (partitioned) indexes too. Probes on PostgreSQL 14 and 18 confirm the ATTACH pairs a valid one and passes over an invalid one, building the index across the whole tree. The pairing already skipped invalid indexes.
  • A parent PRIMARY KEY or UNIQUE constraint is taken when the table already has the matching key. Otherwise it is refused with attach-partition-index-unsupported before anything is built; the key build follows in the next PR.
  • The partitioned build's refusals reach the step: a foreign table below the table, and a unique index that does not cover a partition key in the table's tree.
  • A standalone table's proof now checks the kind it was resolved as, so a partitioned table is never taken for a plain one.

Before / after

Take visits, indexed on id and lower(page), and visits_2027, partitioned by region into visits_2027_eu and visits_2027_us, which is split again by id. The index step runs on visits_2027 before the attach. Before, it refused the table; after, it builds both indexes across the tree without blocking writes, and the ATTACH takes them.

Before
  ensureAttachIndexes(visits → visits_2027)
    └─ visits_2027 is of kind 'p'  ──▶  refused, nothing built
  ATTACH visits_2027 run as written
    └─ builds visits_id_idx and visits_page_idx on all 3 leaves under ACCESS EXCLUSIVE

After
  ensureAttachIndexes(visits → visits_2027)
    ├─ visits_id_idx   ──▶  partitioned build of visits_id_idx_p<oid> on visits_2027
    │     ├─ CREATE INDEX ... ON ONLY visits_2027 and ON ONLY visits_2027_us
    │     ├─ CREATE INDEX CONCURRENTLY on _eu, _us_low, _us_high (writes go on)
    │     └─ ATTACH each level bottom up  ──▶  valid
    ├─ visits_page_idx ──▶  the same, for lower(page)
    └─ re-read: the ATTACH pairs both, builds nothing
  ATTACH visits_2027
    └─ every index on all 5 tables is the one the step gave it, now attached

The attach index step now gives a table that is itself partitioned a valid
partitioned index for each of the parent's plain indexes, by running the
partitioned index build on it, so the ATTACH pairs them and builds nothing.
A parent key constraint is taken only when the table already has it.
@Kiran01bm
Kiran01bm marked this pull request as ready for review December 3, 2026 05:04
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-03T05:04:18.691043Z
We couldn’t complete this review. Comment @codex review to try again.
e06c45b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@aparajon

aparajon commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

🤖 Review 1/2 (correctness) of e06c45b: 0 blocking, 4 non-blocking.

Inspected the whole change at e06c45b4b1235fe2a7a434ef972469b6c5664445 (7 files, +394/-47): the new attach_index_partitioned.go, the two new cases in the ensureAttachIndexes switch, the relaxed kind guard (#L102-L105), the pairing read that now lists 'I' indexes (attach_index_pairing.go#L170-L174), and the standalone proof that now takes the kind as a parameter (partition_tree.go#L150-L170). I read them against runPartitionedIndex (partitioned_index_flow.go#L52), which the step now calls directly, and against BuildPartitionedIndexAt, the public caller it skips the front half of. CI at the time of posting: 16 of 18 checks green, including build, lint, the docs guards, Supabase compatibility, test (PostgreSQL 14) through test (PostgreSQL 17) and test (PostgreSQL 18, schemachange). Two are red: test (PostgreSQL 18, other packages) and, with it, the all-green gate. The red leg is a Docker reaper failure in pkg/dbconn, which this PR does not touch (finding 4); pkg/executor itself passed on PostgreSQL 18 in that same leg (ok ... pkg/executor 219.886s).

What the change does: for a table to attach that is itself partitioned, a parent index that backs no constraint and that the pairing gives nothing is built as a valid partitioned index of the table under the derived name, by calling the existing partitioned index build on the table. A parent PRIMARY KEY or UNIQUE is taken only when the pairing already gives the table one, and is refused typed otherwise. I could not find a defect that fires today, and nothing here can reach production data yet: resolve still refuses a table whose kind is not r, and prepare still builds its node with standaloneTable (kind r), so the new branches are reachable only from the step's own tests. The pieces that carry the safety hold. The pairing and the server agree on what to skip, since attachTakes already ignores an invalid or attached index and the read now returns partitioned ones too. The two prove() calls bracket the build with the same standalone proof, now keyed on the kind the table was resolved as, so a table swapped for another kind refuses (TestEnsureAttachIndexesRefusesATableOrParentItDoesNotTake, "a partitioned table resolved as a plain one"). The closing read still requires every parent index to pair with the index reported for it (attachIndexesComplete), which is what makes a wrong "found" fail closed instead of attaching with a scan.

Invariants (docs/invariants.md): upholds ST-7 (#L1770; the kind the proof checks is now the resolved one, and the entry's own sentence for this step needs a wording update, see comment 2/2 finding 1), extends LK-2 (#L840; each leaf build still runs under the partitioned build's own bounded steps and the run's budget, but its tracker hand-off has no test, finding 2), upholds LK-1 (#L725; the run still holds the parent's advisory lock and the build runs under its locked context) and CO-9 (#L518; the two changed queries are pg_catalog-qualified, relkind is cast to pg_catalog.text), and brushes ST-6 (#L1668; finding 1).

Consistency with #702, #710 and #712: this PR is the index half of what #702 does for foreign keys on a sub-partitioned table, and it stays out of their files. It uses relkind on the standalone node the way #702's step does on its leaves, it leaves #712's resolvedFK.attach alone, and like #712 (finding 2 there) it has a refusal that comes after earlier steps have already built something (finding 1 below).

Non-blocking

  1. A parent key the partitioned table lacks is refused after the earlier parent indexes have been built, so "before anything is built" holds only when the key sorts first. The loop walks the parent's indexes in OID order (parentIndexesSQL's ORDER BY c.oid) and decides each one only when it gets to it (#L125-L147). The PR body says the key is refused "before anything is built", and the new test (#L178) has the key as the parent's only index. A parent whose key was added after a plain index (an ALTER TABLE ... ADD PRIMARY KEY on a table that already has visits_page_idx) puts the key's OID after the plain index's, so the step first builds a partitioned index across the whole tree and only then reaches the key and refuses it. A partitioned build under Index is one budget per leaf, so on a wide tree the work thrown at an attach that can never succeed is the longest of any step. The result is safe and a rerun keeps the built index, and the sibling refusals have the same shape ("earlier indexes stay", #L78-L79; the same ordering question came up on executor: refuse a NOT VALID foreign key differing in its ON DELETE list #712), so this is non-blocking. The refusal needs only first.parent and paired, which are known before the first build: a pre-pass over the parent indexes that returns pairedPartitionedKey's error for any key constraint with paired[i] == 0 on a sub-partitioned table would make the claim true for every ordering (ST-6: a knowable refusal is made before the first write). Reasoned from the catalog order, not run.
Test case (not run here: no local checkout): a missing key is refused before any index is built
func TestEnsureAttachIndexesRefusesAPartitionedTablesMissingKeyBeforeBuildingAnyIndex(t *testing.T) {
	withAttachProofServer(t, func(t *testing.T, newFixture func(t *testing.T) attachProofFixture) {
		f := newFixture(t)
		f.exec(t, visitsByRegion) // visits_id_idx and visits_page_idx first
		f.exec(t, `ALTER TABLE %[1]s.visits ADD CONSTRAINT visits_pkey PRIMARY KEY (id, day, region)`)

		_, err := ensureAttachIndexes(t.Context(), f.pool, f.parentOID(t, "visits"), f.standalonePartitioned(t, "visits_2027"), attachIndexBudget, nil, 0, nil)
		require.ErrorIs(t, err, errAttachIndexUnsupported)
		for _, rel := range visits2027Tree {
			assert.Empty(t, f.tableIndexes(t, rel), "%s has no index", rel)
		}
	})
}

At the head the two plain parent indexes sort before the key, so visits_2027 and its leaves hold the derived indexes when the error returns and the last assertion fails; with the pre-pass it passes. Not run.

  1. The runStep hand-off, the one signature change, has no test, and nothing pins that a partitioned build reports to, and is stopped through, the run's tracker. prepare now passes f.runStep to the step, and every call site in the tests passes nil, 0. With tracker non-nil and runStep 0 the build takes its own step numbers and raises the run's total (countNewPartitions, partitioned_index_flow.go#L184-L186), which a host that owns the tracker does not expect; so replacing f.runStep with 0 in prepare leaves every test green. It is unreachable end to end today (the flow refuses a partitioned table), which is why TestAttachPartitionOnlineReportsAndCancelsAPlainIndexBuildOnTheTracker cannot be copied, but the step can be driven directly with a tracker, as TestBuildPartitionedIndexAsStepReportsEveryPartitionAsTheCallersStep does for the build itself: one case that passes a tracker started with the run's total and runStep 1, then asserts the total did not grow and the statements landed on step 1, would pin it. The plain and key builds also hand started the build's statement before they run it so the run's step names a build "only while one can run" (#L219-L225); the partitioned path does not use started and relies on startStep inside the build, which is the right call, but the LK-2 paragraph that lists what hands the tracker to a build (invariants.md#L931-L943) names the plain and key builds only. Reasoned from the code, not run.

  2. Three branches the PR adds have no test that fails when they are removed.

    • The kind guard. attach_index.go#L102-L105 is now the only thing that stops the step on a table that is neither plain nor partitioned, such as a foreign table (whose standalone proof, keyed on kind f, would pass). The test that used to reach it set relkind = "p"; that case was repurposed to "a partitioned table resolved as a plain one", which now ends in the proof (ErrInvariantViolation), so deleting the guard leaves the suite green.
    • The unique branch's pass case. Only the refusal is tested (#L209). A parent CREATE UNIQUE INDEX that does contain every partition key (here (id, day, region)) goes through statement.IndexKeyElements (attach_index_partitioned.go#L53-L57) and then the build, and no test builds one; a regression there that misreads the keys would refuse every unique index (fail closed) with the suite green.
    • Two parent indexes of one definition. The plain step has TestEnsureAttachIndexesBuildsAnIndexForEachOfTwoIdenticalParentIndexes and a case for a derived name held by the first's index, because takenByOthers feeds the plain step's occupant check. The partitioned step ignores taken. By reading, a fresh run still gives each parent index its own derived index (each name embeds the parent index's name, and the leaf build takes only an index no partitioned index owns), and a derived index that the pairing hands to the other parent index ends in errAttachIndexIncomplete, which is the right failure; but no test shows either.
      Each is one short case next to the existing ones. Reasoned, not run.
  3. The red test (PostgreSQL 18, other packages) check is a Docker reaper failure in pkg/dbconn, not this change. The one failing test is TestConnectReplicationAsksForWarningsThroughPgBouncer (the job's make test-db-rest), which stops while creating its pooler network: reaper: from container "4cfc4046": wait for reaper 4cfc4046: unexpected container status "removing", from internal/testutil/pgbouncer.go#L85 via pkg/dbconn/replication_integration_test.go#L123, 0.13 s in. The job's later packages ran on, and pkg/executor (which holds every test this PR adds) and pkg/migrate both passed in that leg. The PR changes only pkg/executor files, which pkg/dbconn does not import. Nothing for the author to change, but all-green blocks the merge until the leg is rerun; I did not rerun it.

Verified

  • Read the whole diff and the unchanged code it leans on (runPartitionedIndex and its flow, BuildPartitionedIndexAt, attachTakes/pairAttachIndexes, attachIndexesComplete, readAttachIndexState, resolve, prepare, standaloneNodeSQL/proveNodeIn). I ran no test: every new scenario starts a PostgreSQL container and I have no checkout here; the test (PostgreSQL 14) to test (PostgreSQL 17) legs and the PostgreSQL 18 other-packages leg ran pkg/executor at this head and it passed.
  • The step skips the front half of BuildPartitionedIndexAt (admission of a user statement, the CallerOwned context check, the pool-size check and the parent lock). Each is covered by the attach around it: the statement is the executor's own PartitionIndex output from the catalog, AttachPartitionOptions.validate and attachPartitionAt check the budget and the buildMinConns pool size before the lock, the lock is the parent's, and the leaf builds repeat the CallerOwned check in cic_build.go.
  • The pairing matches the server's walk (AttachPartitionEnsureIndexes): a partitioned index is paired only when valid and attached to nothing, so an index a stop left invalid is passed over and then resumed by the build, which is what the "resumes" test pins.
  • Mutation table (by reading, since the scenarios need a live PostgreSQL):
Mutant Caught by
relkind list back to 'i' only in attachTableIndexesSQL ...GivesAPartitionedTableValidPartitionedIndexes (the rerun must find both), ...TakesAPartitionedIndexTheTableHas
$4 replaced by the literal 'r' in standaloneNodeSQL every new test (the proof refuses the partitioned table)
case table.subPartitioned() dropped before ensureAttachPartitionedIndex ...GivesAPartitionedTableValidPartitionedIndexes (the plain step cannot index a partitioned table)
pi.contype != "" && table.subPartitioned() case dropped ...GivesAPartitionedTableOnlyAKeyItHas (refusal expected, nothing built)
action always attachIndexBuilt the rerun case (expects found)
kind guard at #L102-L105 deleted survives (finding 3)
unique branch always skipping keyElements refusal case caught; the pass case does not exist (finding 3)
f.runStep replaced by 0 in prepare survives (finding 2)

This review was generated by Claude Code (claude-sonnet-5-5).

@aparajon

aparajon commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

🤖 Review 2/2 (OSS adoption and integration) of e06c45b: 0 blocking, 3 non-blocking.

Read the change from two seats: a host (a schema change orchestrator, or any importer of pkg/executor) that drives AttachPartitionOnline or AttachPartitionOnlineAsStep and routes each Code to an operator, and a contributor who reads docs/invariants.md and docs/execution-model.md to learn what the attach does and refuses. The exported surface does not move: every changed function is unexported, the flow still refuses a table that is not a plain table (comment 1/2), and no Code is added. So no host sees a change today. What this PR sets is what the next one inherits, which is why the three points below are about the words and the contract the new branches already carry.

Non-blocking

  1. Four places in the docs describe this step as it was before the PR. Two still treat the table to attach as a plain table, one leaves the partitioned build out of its list, and two do not list the new refusal. The registry and the code-routing docs are what a host author reads to decide what to retry, so they should be true when the flow opens up to partitioned tables, and this PR is the one that changes what the step takes.

    • invariants.md#L1809-L1812 (ST-7, #L1770) says the attach index step proves "the table to attach still that plain table". The proof is now "of the kind it was resolved as" (partition_tree.go#L146-L170), a plain or a partitioned one. The enforcement pointer still resolves to the right place (standaloneNodeSQL through proveNodeIn, TestEnsureAttachIndexesRefusesATableOrParentItDoesNotTake); it is the sentence that is stale.
    • LK-2 (#L931-L943) lists what hands the run's tracker to a concurrent build: the plain builds of attach_index.go and the key builds of the leaf key step. The partitioned build the step now calls on a partitioned table reports to it too (on runStep), and the paragraph should say so once a test pins it (comment 1/2, finding 2).
    • The attach-partition-index-unsupported row of execution-model.md#L459 says a table that is not a plain table is refused earlier, "the index step's own check of it" reporting this code. For a partitioned table the index step no longer refuses; only a kind that is neither plain nor partitioned reaches that check. The row also lists the parent's EXCLUDE, DEFERRABLE and non-plain keys, and not the new case: a parent PRIMARY KEY or UNIQUE that a partitioned table to attach does not already have.
    • The same case is missing from the attach-partition-index-unsupported entry of the routing table in schemabot-integration.md#L1032, the one place a host reads what to tell the operator ("an EXCLUDE or DEFERRABLE key of the parent"). The code is "no, permanent" there, and the new refusal is permanent only until the next PR gives the table its key.
      Four short edits close it; none changes behavior.
  2. A refusal from the partitioned build reaches the host under its own code, and that code's documented remedy is written for a statement the host does not have. The step wraps the partitioned build's errors (attach_index.go#L143-L145, errors.Is still matches), so CodeOf returns unique-index-partition-key, foreign-table-partition or partitioned-index-name-taken (code.go#L766-L771) for an attach. The unique-index-partition-key row tells the operator to "add the missing partition key columns to the index's key" and calls it a refusal "in the dry run too"; in an attach the index is the parent's, the run has no index statement to edit, and the attach's admission does not run the check (so no dry run shows it). The case is real once the flow opens: a parent unique index on (id, day) and a table to attach partitioned by region cannot be attached at all (the server refuses the same pair at the ATTACH), and the operator's way out is to change the parent's index in its own run, or to stop. One sentence in the row, or in the host-routing table of schemabot-integration.md where the attach codes are listed, saying that in an attach the key is the parent's and the fix is to the parent's index or the table's partitioning, would keep a host from forwarding advice that cannot be followed. Reasoned from the docs and the code, not run.

  3. The refusal for a missing key does not say what is missing, and AttachPartitionOptions.Index still describes one build per index. Two small things in what a host or operator reads:

    • pairedPartitionedKey returns "<table> is partitioned, and the step does not give it the key constraint <name>". parentIndex already holds the key's columns (pi.columns) and kind (pi.contype), which are what an operator needs to create the key on the table by hand today. Naming them (for example "add PRIMARY KEY (id, day, region)") makes the permanent stop actionable, and the text is what a host copies into a comment, as with executor: refuse a NOT VALID foreign key differing in its ON DELETE list #712's message.
    • AttachPartitionOptions.Index says "bounds each concurrent build of one of the parent's indexes on the table". For a partitioned table the budget bounds each leaf's build inside each parent index's partitioned build, so the longest the step can run is roughly leaves times indexes times the budget, not indexes times the budget (the partitioned_index.go doc says "one budget per partition"). A host that sizes its own deadline from the field's wording would undersize it. One clause on the field closes it; the flow does not take a partitioned table yet, so this is for the PR that opens it, and attachIndexBuilt's comment ("the step built the index concurrently") wants the same clause.

What reads well for adopters

  • The PR body shows one concrete table (visits and visits_2027, three leaves under a sub-partition) through the old and the new behavior in matching shapes, with the old stop (refused, then the ATTACH building both indexes on three leaves under ACCESS EXCLUSIVE) and the new one (both indexes built across the tree while writes go on, the ATTACH building nothing), which is the contrast a host author needs.
  • The description is honest about scope: the flow "still refuses" a partitioned table "until the foreign key step follows", and the key build is named as the next PR, so a reader knows the new branches are not live yet.
  • Every refusal is typed through sentinels the repo already routes (errAttachIndexUnsupported, ErrForeignTablePartition, UniqueIndexPartitionKeyError), so no host code changes and no new Code appears; the tests assert the typed error and that nothing was built, the claim a host relies on.
  • The new test file opens with what it exercises and why, names the scenario in each test comment, and reuses the attach fixture, so a contributor adding the key build in the next PR has the harness (standalonePartitioned, visitsByRegion, visits2027Tree).

This review was generated by Claude Code (claude-sonnet-5-5).

@aparajon aparajon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Stamping with comments: 0 blocking, 7 non-blocking (see the review comments above).

This stamp was left by Claude Code (claude-sonnet-5-5).

@JashLal

JashLal commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

🤖 I reviewed all seven changed files at e06c45b against its stack base. The integration tests cover reusing an existing index, resuming an invalid one, and preserving index OIDs across the eventual attach.

Bind the nested build to the resolved source before enabling partitioned sources in the public flow. The wrapper proves the standalone source in a catalog read, then hands off only schema and name. If a concurrent rename puts an equivalent partitioned table under that name before the nested build resolves it, the nested build accepts the replacement OID and can commit index DDL there. The final standalone proof rejects the original attach after those writes. Pass the expected standalone node into the builder and prove it under the root DDL lock before creating or using the root index. The public flow still refuses partitioned sources at this head. Attach index handoff · Nested target resolution

GitHub reported 16 successful checks and two failures. I reviewed the code and the visible PR discussion. I did not run tests locally. PostgreSQL 18 other packages · all-green

Builderbot’s review result was unavailable. I did not independently verify unresolved inline threads.

@JashLal JashLal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Approved by Codex on Jash behalf after reviewing e06c45b. See the review comment for findings and verification limits; approval does not resolve those findings. Preserve the stack merge order and resolve the source-identity gap before wiring the public flow.

Refuse a partitioned table's missing parent key before any index is
built, name the key to add, and cover the kind guard, the unique and
duplicate-index cases, and the tracker hand-off the reviews flagged.
@Kiran01bm

Copy link
Copy Markdown
Collaborator Author

🤖 Adversarial review response — created by Kiran's code review agent (Amp, claude-opus-5-5) — pull/713, follow-up commit

All 8 findings from the three review comments are fixed in the follow-up commit. Nothing is deferred and nothing is rejected.

# Finding Status Explanation
C3-F1 The nested partitioned build resolves the table to attach by name, so a table renamed into place could take index DDL fixed partitionedIndexRequest now carries the table's OID. The build's resolveTarget refuses, as ErrInvariantViolation, a name that resolves to another table, before anything is created. Every later step was already keyed on that OID. Pinned by TestRunPartitionedIndexRefusesATableRenamedIntoTheResolvedOnesName
C1-F1 A missing parent key is refused only after earlier parent indexes are built fixed refuseMissingPartitionedKeys runs on the first read, before any build, so the refusal comes with nothing built whatever the OID order. Pinned by TestEnsureAttachIndexesRefusesAPartitionedTablesMissingKeyBeforeBuildingAnyIndex (a key added after both plain indexes)
C1-F2 Nothing tests the runStep hand-off; LK-2 omits the partitioned build fixed TestEnsureAttachIndexesReportsAPartitionedBuildAsTheRunsStep drives the step with a tracker on step 2 and asserts the total does not grow. LK-2 now lists the partitioned build and names that test
C1-F3 The kind guard, the unique pass case, and two identical parent indexes are untested fixed Three cases added: a foreign table resolved as one is refused by the kind check (errAttachIndexUnsupported, not the proof); a parent unique index on (id, day, region) is built valid and the ATTACH keeps it; and two parent indexes of one definition each get their own partitioned index
C2-F1 Four doc passages describe the step as it was before the PR fixed ST-7 now says "of the kind it was resolved as" and names the OID pin. LK-2 lists the partitioned build. The attach-partition-index-unsupported rows in execution-model.md and schemabot-integration.md name the missing-key case, and the first no longer calls every non-plain table an earlier refusal
C2-F2 The unique-index-partition-key remedy assumes a statement the attach host does not have fixed Both rows now say that in an attach the index is the parent's and no dry run shows the refusal, so the fix is to change the parent's index in its own run, or the table's partitioning
C2-F3 The missing-key refusal does not name the key; the Index budget doc undersizes a partitioned build fixed The refusal now names the key and its columns to add (add PRIMARY KEY ("id", "day", "region") to …). AttachPartitionOptions.Index and attachIndexBuilt say the budget bounds each leaf's build inside each parent index's build
C1-F4 The red test (PostgreSQL 18, other packages) check is a Docker reaper failure in pkg/dbconn no action Agreed: the failure is unrelated to this change, and pkg/executor passed in that leg. The follow-up push reruns CI

The "Verified" and mutation-table sections of the first comment, and the "What reads well for adopters" section of the second, need no action.

Source: block/pg-sprite#713, review comments 7368504738, 7368506078 and 7383631457, and reviews 6164061019 and 6173132628, at head e06c45b4; fixes in the follow-up commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants