Skip to content

3.1 pre-migrate tests: no race in R1's mid-build check, and cancellations counted from the migrate's start - #775

Merged
kiwidream merged 4 commits into
3.x.xfrom
RobertClarke/p31-premigrate-followup
Oct 27, 2026
Merged

kiwidream merged 4 commits into
3.x.xfrom
RobertClarke/p31-premigrate-followup

Conversation

@RobertClarke

@RobertClarke RobertClarke commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #773. Tests only: crates/qbit-prism-dual-sim.

Two R1 flake risks. CI on #773 didn't hit either of these, but a local run against rc.6 did.

  • Mid-build race. R1 waited for 031's CREATE INDEX CONCURRENTLY to appear in pg_stat_activity. The statement appears there before it has committed p0's leaf index to the catalog, so the mid-build check could find no leaf. R1 now waits until the leaf exists, invalid, with the build still running.
  • Start-up timeouts counted. The no-cancellation checks read each frontend's whole log. Lock timeouts the pair met on its own while starting, before the migrate began, therefore failed the scenario: rc.6's start-up on a busy host hit some. The checks now count only lines logged from the migrate's start, using each line's RFC 3339 time.

The by-hand measurement's seed. Each share id now leads with the row's number, so the unique index on share_id grows at its right edge. With random ids, every 1M-row batch past the cache cost a random write per row. That came to over two hours for 15M rows, and 031 never reads that index. shared_buffers is now a setting: PRISM_PREMIGRATE_SHARED_BUFFERS, default 2GB for the measurement, 128MB for the lane's p0 test.

The seed is checkpointed before measuring. A checkpoint still syncing the seed's writes stalled every commit on fsync, the migrate's and the appender's: the host's disk, not the migrate. The seed now ends with a CHECKPOINT, before the statement log's offset is taken.

Uncoloured log lines keep their time. The start-of-migrate filter stripped a colour code's remainder from the text before the first escape too, so a line logged without colour lost its leading time and was always kept. Only text after an escape is stripped now.

Branch updated with 3.x.x (v3.1.0) by a merge commit; the PR's own diff is unchanged by it.

Local results (rc.6 binary): after the merge and these changes, both R1 tests passed again (pair scenario and p0 test).

Earlier: R1 passed 2 of 2 runs. Clippy and the dual-sim unit tests pass.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…ions from the migrate's start

- R1 waited for 031's CREATE INDEX CONCURRENTLY in pg_stat_activity, which
  shows before the statement has committed p0's leaf to the catalog, so the
  mid-build check could read no leaf. It waits for the leaf to exist,
  invalid, with the build still running.
- The no-cancellation checks read the frontends' whole logs, so statement
  timeouts the pair met on its own while starting, before the migrate, failed
  the scenario. They count from the migrate's start.
- The measurement's seed leads each share id with the row's number, so the
  unique index on it grows at its right edge. Random ids made every batch
  past the cache a random write per row, hours at 15M rows, and 031 never
  reads that index. Its shared_buffers is a setting
  (PRISM_PREMIGRATE_SHARED_BUFFERS, default 2GB; 128MB in the lanes).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T16:57:48.346878Z a69c600 New commits
ℹ️ 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.

RobertClarke and others added 2 commits October 26, 2026 16:23
… the time of an uncoloured log line

The seed's writes are flushed with a CHECKPOINT before anything is
measured, so a checkpoint still syncing them cannot stall the migrate's
and the appender's commits on fsync.

log_lines_since stripped a colour code's remainder from the text before
the first escape too, so a line logged without colour lost its leading
time and was kept whatever its time. Only text after an escape is
stripped now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No findings.

@kiwidream kiwidream changed the title DO NOT MERGE without coordinator GO: 3.1 pre-migrate tests: no race in R1's mid-build check, and cancellations counted from the migrate's start 3.1 pre-migrate tests: no race in R1's mid-build check, and cancellations counted from the migrate's start Oct 27, 2026

@qbit-reviewer qbit-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No findings.

@kiwidream
kiwidream merged commit 522a33c into 3.x.x Oct 27, 2026
41 checks passed
@kiwidream kiwidream mentioned this pull request Oct 28, 2026
1 of 5 tasks
@RobertClarke
RobertClarke deleted the RobertClarke/p31-premigrate-followup branch November 3, 2026 20:47
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.

2 participants