Skip to content

ACE-186: mtree init publication ordering + exclude metadata from spock#119

Open
danolivo wants to merge 6 commits into
mainfrom
ace-186
Open

ACE-186: mtree init publication ordering + exclude metadata from spock#119
danolivo wants to merge 6 commits into
mainfrom
ace-186

Conversation

@danolivo
Copy link
Copy Markdown
Contributor

@danolivo danolivo commented May 15, 2026

Summary

Fixes publication "ace_mtree_pub" does not exist (SQLSTATE 42704) during ace mtree table-diff on Spock-enabled clusters. Customer-reported. The interim workaround was --skip-cdc; this PR removes the need for it on new init runs.

Root causes

Two interacting defects in MtreeInit:

  1. Init order. The replication slot was created before the publication was committed to WAL. The slot's consistent point therefore preceded the publication, and pgoutput's get_publication_oid failed during change-callback replay.
  2. Spock replication of ace_cdc_metadata. Under DDL replication the metadata table was auto-added to Spock's default repset; each node's node-local start_lsn leaked cross-node and overwrote peer LSNs.

Either bug in isolation is harmless. Together they steer processReplicationStream into a silent rewind to the slot's pre-publication LSN → 42704.

What changed

  • MtreeInit is split into three phases per node. Phase A (tx1) creates schema/helpers/metadata table, removes it from every Spock repset, creates the publication, and captures the publication's commit LSN. Phase B creates the replication slot (consistent point now strictly after the publication). Phase C (tx2) persists slot_name / start_lsn / pub_commit_lsn to ace_cdc_metadata, wrapped in spock.repair_mode(true).
  • New pub_commit_lsn column on ace_cdc_metadata (additive, ALTER TABLE IF NOT EXISTS).
  • New runtime guard in processReplicationStream: refuses to open a stream whose start_lsn is older than pub_commit_lsn, with an actionable error pointing at mtree teardown + mtree init. The previous silent rewind to slot.confirmed_flush_lsn is gone.
  • New CDC helpers: ExcludeMetadataFromSpockRepsets, SetSpockRepairMode, CurrentWalInsertLSN. spock.tables is filtered WHERE set_name IS NOT NULL because that view surfaces every Spock-known relation, NULL-set_name for tables not in any repset — pgx would otherwise crash with cannot scan NULL into *string.
  • Regression test tests/integration/cdc_init_ordering_test.go covers the three invariants the fix preserves: slot ordering, repset exclusion, runtime guard.

Reviewer notes

  • spock.repair_mode is session-scoped, not transaction-scoped. SQL ROLLBACK does NOT reset it. Every Set(true) must reach Set(false) on every code path, including error paths — otherwise the pooled connection is returned poisoned and the next borrower's writes silently don't replicate. Every site that toggles repair_mode now carries a CAUTION block making this explicit. A follow-up patch to use defer Set(false) on a borrowed *pgxpool.Conn would harden this further but is out of scope here.
  • Existing broken installs are not auto-repaired. Users on affected clusters must run ace mtree teardown + ace mtree init + ace mtree build after upgrade. --skip-cdc remains a valid workaround pre-upgrade.
  • CheckSpockInstalled runs on every SetSpockRepairMode call; in continuous CDC mode that's ~12 round-trips/min for a value that's fixed for a Postgres lifetime. Easy follow-up to cache on the pool.
  • The branch was restructured to two commits (fix-first, then test) so every commit is buildable and git bisect-clean.

Andrei Lepikhov and others added 2 commits May 15, 2026 14:05
Fixes 'publication "ace_mtree_pub" does not exist' (SQLSTATE 42704)
during 'ace mtree table-diff' on Spock-enabled clusters.

Two root causes addressed:

1. Init order: the replication slot was being created before the
   publication was committed to WAL. The slot's consistent point
   therefore preceded the publication, and pgoutput's
   get_publication_oid failed during change-callback replay.
   MtreeInit is now split into three phases per node: Phase A
   commits schema + metadata table + publication and captures the
   publication commit LSN; Phase B creates the slot (its consistent
   point is now strictly after the publication); Phase C persists
   slot/start_lsn/pub_commit_lsn.

2. Spock replication of ace_cdc_metadata: under DDL replication the
   metadata table was auto-added to Spock's default repset, so each
   node's node-local start_lsn leaked across the cluster and
   overwrote peer LSNs. ExcludeMetadataFromSpockRepsets enumerates
   spock.tables and removes the metadata table from every repset it
   landed in; all metadata writes (init, periodic flush, on-shutdown
   flush, final update) now wrap their write in spock.repair_mode
   to defend against the per-node-init race where a peer's repset
   still contains the table. spock.tables surfaces every Spock-known
   relation with NULL set_name for tables not in any repset, so the
   enumeration filters AND set_name IS NOT NULL.

CAUTION applied at every SetSpockRepairMode site: repair_mode is
session-scoped, not transaction-scoped — SQL ROLLBACK does NOT reset
it. Callers must reach Set(false) on every code path or the pooled
connection returns poisoned.

A new pub_commit_lsn column is added to ace_cdc_metadata (additive,
ALTER TABLE IF NOT EXISTS). processReplicationStream refuses to open
a stream whose start_lsn is older than pub_commit_lsn, returning an
actionable error instead of silently rewinding to a pre-publication
LSN. Empty pub_commit_lsn (legacy metadata rows) skips the check
with a warning.

Existing broken installs are not auto-repaired; users must run
'ace mtree teardown' + 'ace mtree init' + 'ace mtree build' after
upgrade. '--skip-cdc' remains a valid interim workaround for
pre-upgrade clusters.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add tests/integration/cdc_init_ordering_test.go covering the three
invariants the fix preserves:

- slot's confirmed_flush_lsn >= ace_cdc_metadata.pub_commit_lsn on every
  node (Bug 1: slot consistent point must not precede publication commit).
- ace_cdc_metadata is removed from every Spock repset on every node; the
  test seeds it into 'default' between two init calls so the assertion
  bites on pre-fix code (Bug 2).
- processReplicationStream returns the actionable guard error, not raw
  SQLSTATE 42704, when start_lsn precedes pub_commit_lsn.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Adds pub_commit_lsn to CDC metadata, enforces a publication-commit ordering guard during replication stream startup, excludes and isolates metadata writes from Spock repsets via session-scoped repair mode on dedicated connections, and adds integration tests validating ordering and Spock exclusions.

Changes

CDC Publication-Commit Ordering and Isolation

Layer / File(s) Summary
SQL Templates and Query Functions for Publication-Commit Tracking
db/queries/templates.go, db/queries/queries.go
New SQL templates support pubCommitLSN in CDC metadata schema, initialize metadata with commit LSN, and manage Spock repsets and repair mode. Six new query functions read/write metadata with pubCommitLSN, enumerate and manipulate Spock repsets, fetch current WAL insert LSN, and toggle session-scoped repair mode.
Node Initialization with Publication-Commit Capture
internal/consistency/mtree/merkle.go
MtreeInit loop delegates per-node setup to a new initOneNode helper that orchestrates three phases: (A) schema and publication setup with publication commit LSN capture; (B) replication slot creation to confirm a consistent point; (C) metadata persistence using Spock repair mode for node-local writes, with orphan slot cleanup on phase C failure.
Publication-Commit Guard and Repair-Mode Metadata Updates
internal/infra/cdc/listen.go
Stream processing retrieves pubCommitLSN alongside start LSN and enforces an ordering check that prevents streaming when start LSN is older than publication commit LSN. Removes prior logic that adjusted LSN via confirmed_flush_lsn, and wraps both shutdown and periodic metadata updates with Spock repair mode enable/disable calls to isolate writes.
Spock Helper Functions
internal/infra/cdc/setup.go
Two new helpers conditionally detect Spock installation: ExcludeMetadataFromSpockRepsets removes the metadata table from all repsets to prevent cross-node leakage, and SetSpockRepairMode wraps session-scoped repair mode toggle.
Test Updates and Integration Tests
tests/integration/cdc_busy_table_test.go, tests/integration/cdc_init_ordering_test.go
Existing test call site updated for expanded GetCDCMetadata signature. Three new integration tests validate that replication slots confirm >= publication commit LSN, that metadata table is excluded from Spock repsets after initialization, and that the publication-commit guard rejects stale start LSN values with explicit error messaging.

Poem

Little rabbit hums beneath the nodes,
I mark the commit LSN where history grows.
Repair mode snug, the metadata stays near,
Repsets drop their tables, quiet and clear.
Tests hop in to prove the order here. 🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: mtree initialization publication ordering and excluding metadata from Spock, which directly addresses the root causes fixed in this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description directly relates to the changeset, explaining the root causes (init order and Spock replication), the three-phase fix to MtreeInit, new pub_commit_lsn column, runtime guards, and new CDC helpers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ace-186

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@danolivo danolivo requested a review from mason-sharp May 15, 2026 12:09
@danolivo danolivo changed the title fix: mtree init publication ordering + exclude metadata from spock ACE-186: mtree init publication ordering + exclude metadata from spock May 15, 2026
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 15, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 18 complexity · 5 duplication

Metric Results
Complexity 18
Duplication 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Codacy flagged the test body as 61 LOC (limit 50). Pull the two-node
fan-out loops and the sentinel-propagation block into named helpers:
seedMetadataInDefaultRepset, assertMetadataNotInAnyRepset,
assertSentinelDoesNotPropagate, plus mtreeTestNodes() to centralise the
(name, pool) pair list. The test body is now 21 LOC and reads as
arrange → act → assert.

The six "SQL injection" findings Codacy raised on the same file are
AI-classified false positives: the %s substitution is config.Cfg.MTree.Schema
(a config-loaded identifier sanitised at load time), and the line at
seedMetadataInDefaultRepset's spock.repset_add_table call is in fact
parameterised via $1 — Codacy misread the surrounding fmt.Sprintf.
No code change needed for those.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
db/queries/templates.go (1)

376-387: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Split this multi-statement template into separate Exec calls.

The template emits CREATE TABLE ...; ALTER TABLE ... as a single SQL string. pgx v5 uses the extended protocol by default, which does not support multiple statements in a single Exec() call. This will fail at runtime. Either split into two separate templates with two Exec calls, or explicitly configure the connection to use QueryExecModeSimpleProtocol (not found in the codebase).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@db/queries/templates.go` around lines 376 - 387, The template
CreateCDCMetadataTable currently emits two SQL statements ("CREATE TABLE ...;"
and "ALTER TABLE ...;") in one string which fails under pgx v5 extended
protocol; split this into two separate templates and Exec calls: keep the CREATE
TABLE statement in CreateCDCMetadataTable (or a renamed
createAceCDCMetadataTable) and move the ALTER TABLE ... ADD COLUMN IF NOT EXISTS
pub_commit_lsn into a new template (e.g., AddPubCommitLsnToAceCDCMetadata) and
call Exec for each template separately, referencing {{aceSchema}} and
ace_cdc_metadata in both so they run sequentially at migration time.
🧹 Nitpick comments (1)
internal/infra/cdc/setup.go (1)

90-99: 🏗️ Heavy lift

Consider constraining the API signature to enforce session pinning.

All current call sites correctly use pinned transactions (tx from pool.Begin()), but the function signature accepts a generic queries.DBQuerier. While the wrapper at db/queries/queries.go:3007 documents that Set(true) and Set(false) must pair on the same session, the generic API allows future callers to pass a pool handle and inadvertently separate the toggles across sessions, poisoning one connection.

Consider adding compile-time enforcement (e.g., a type wrapper or interface constraint) to make session-pinning explicit and prevent misuse.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/infra/cdc/setup.go` around lines 90 - 99, SetSpockRepairMode
currently accepts a generic queries.DBQuerier which lets callers pass a pool
handle and accidentally toggle repair mode on different sessions; change the API
to require a session-bound type (e.g., accept the transaction/session interface
used by pool.Begin() such as a queries.DBTx or a new interface like
queries.SessionQuerier) so SetSpockRepairMode(ctx context.Context, session
queries.SessionQuerier, on bool) enforces compile-time session pinning; update
all callers to pass the tx returned from Begin() and call
queries.CheckSpockInstalled and queries.SetSpockRepairMode on that session so
Set(true)/Set(false) always occur on the same connection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/consistency/mtree/merkle.go`:
- Around line 866-870: The call to queries.CurrentWalInsertLSN that sets
pubCommitLSN is happening while Phase A's transaction (tx) is still open; move
the WAL LSN capture so it occurs after Phase A commits and before Phase B starts
so the read reflects the commit LSN. Concretely: finish and commit the Phase A
transaction first, then call queries.CurrentWalInsertLSN (using an appropriate
context/connection outside the committed tx or a new read-only tx) to set
pubCommitLSN, and only then proceed to Phase B logic (the code that relies on
pubCommitLSN and uses tx/slot-guard checks).

In `@internal/infra/cdc/listen.go`:
- Around line 467-489: After calling SetSpockRepairMode(processingCtx, tx, true)
you must immediately schedule cleanup so session-scoped repair_mode is always
disabled; add defer SetSpockRepairMode(processingCtx, tx, false) right after the
successful true call (before calling queries.UpdateCDCMetadata or committing tx)
so any early return or error path will run the disable. Update or remove the
later explicit SetSpockRepairMode(..., false) calls as needed to avoid
double-disabling or handle their errors gracefully; ensure the deferred call
runs regardless of conn.Close or tx.Commit failures and continues to return the
connection to the pool in a neutral state.

---

Outside diff comments:
In `@db/queries/templates.go`:
- Around line 376-387: The template CreateCDCMetadataTable currently emits two
SQL statements ("CREATE TABLE ...;" and "ALTER TABLE ...;") in one string which
fails under pgx v5 extended protocol; split this into two separate templates and
Exec calls: keep the CREATE TABLE statement in CreateCDCMetadataTable (or a
renamed createAceCDCMetadataTable) and move the ALTER TABLE ... ADD COLUMN IF
NOT EXISTS pub_commit_lsn into a new template (e.g.,
AddPubCommitLsnToAceCDCMetadata) and call Exec for each template separately,
referencing {{aceSchema}} and ace_cdc_metadata in both so they run sequentially
at migration time.

---

Nitpick comments:
In `@internal/infra/cdc/setup.go`:
- Around line 90-99: SetSpockRepairMode currently accepts a generic
queries.DBQuerier which lets callers pass a pool handle and accidentally toggle
repair mode on different sessions; change the API to require a session-bound
type (e.g., accept the transaction/session interface used by pool.Begin() such
as a queries.DBTx or a new interface like queries.SessionQuerier) so
SetSpockRepairMode(ctx context.Context, session queries.SessionQuerier, on bool)
enforces compile-time session pinning; update all callers to pass the tx
returned from Begin() and call queries.CheckSpockInstalled and
queries.SetSpockRepairMode on that session so Set(true)/Set(false) always occur
on the same connection.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5811b76d-c669-4f27-abcf-7fa388daaab6

📥 Commits

Reviewing files that changed from the base of the PR and between a1b3388 and d0e483c.

📒 Files selected for processing (7)
  • db/queries/queries.go
  • db/queries/templates.go
  • internal/consistency/mtree/merkle.go
  • internal/infra/cdc/listen.go
  • internal/infra/cdc/setup.go
  • tests/integration/cdc_busy_table_test.go
  • tests/integration/cdc_init_ordering_test.go

Comment thread internal/consistency/mtree/merkle.go
Comment thread internal/infra/cdc/listen.go Outdated
@ibrarahmad ibrarahmad self-requested a review May 16, 2026 02:20
Copy link
Copy Markdown
Contributor

@ibrarahmad ibrarahmad left a comment

Choose a reason for hiding this comment

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

Diagnosis and ordering invariant look sound; tests cover the right invariants. Notes inline. PR-level nit: the body says "two commits (fix-first, then test)" but the branch has four; either update the description or rebase back to two for a bisect-clean history.

Comment thread internal/infra/cdc/listen.go Outdated
Comment thread internal/consistency/mtree/merkle.go
Comment thread internal/infra/cdc/listen.go
Comment thread internal/infra/cdc/setup.go
Comment thread tests/integration/cdc_init_ordering_test.go Outdated
Comment thread db/queries/templates.go
danolivo pushed a commit that referenced this pull request May 19, 2026
…ming)

Round of fixes for the human review comments on PR #119:

- flushMetadata (listen.go:542): same pool-poisoning hole as Site 1.
  Port to the borrowed-*pgxpool.Conn pattern so Set(false) is deferred
  on the live session before Release. This site fires every 10 s on
  the periodic-flush path AND on shutdown, so it was the highest-risk
  remaining leak.

- MtreeInit Phase C (merkle.go:884): same hole. Borrow the conn,
  defer Set(false) on it, run the InitCDCMetadata write through a
  tx opened on the same conn.

- Guard scope comment (listen.go:103): clarify that the pub_commit_lsn
  guard is a tripwire for partial-state-on-upgrade and for cross-node
  leaks whose LSN lands below local pub_commit_lsn — NOT a general
  leak detector. The actual defenses against cross-node leak are
  repset exclusion + repair_mode wrapping every metadata write.
  Reader-of-the-future shouldn't mistake this for an end-to-end check.

- Test timing (cdc_init_ordering_test.go:186): bump the
  sentinel-propagation window from 3 s to 10 s. 3 s was tight under
  load on slow CI; 10 s gives Spock apply latency real headroom
  without making the test materially slower in the common case.

Two non-blocking comments deliberately deferred to follow-ups:
  - CheckSpockInstalled cache on the pool (~12 RTTs/min savings)
  - Hoist 'ace_cdc_metadata' relname into a shared constant

CodeRabbit's pubCommitLSN-timing finding remains skipped: the invariant
chain captured_mid_tx < commit_lsn(Phase A) <= slot.consistent_point
holds for freshly-created slots, which is the only state Phase B
produces. The hypothetical "broken slot whose consistent_point sits
between captured and commit" cannot arise from this code path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/infra/cdc/listen.go`:
- Around line 568-575: The deferred reset of spock.repair_mode in flushMetadata
currently uses the caller's cancelable ctx which can be canceled before defer
runs; change the defer to use a non-cancelable context (like the pattern in
processReplicationStream) so the reset always runs: keep the initial call
SetSpockRepairMode(ctx, c, true) as-is, then create a non-cancelable context
(e.g. ctxNoCancel := context.WithoutCancel(ctx)) and call
SetSpockRepairMode(ctxNoCancel, c, false) inside the defer; reference
SetSpockRepairMode and flushMetadata to locate and update the defer.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 582e9095-53ab-40a8-a71b-ea48d3c87de7

📥 Commits

Reviewing files that changed from the base of the PR and between d0e483c and 5862fa7.

📒 Files selected for processing (3)
  • internal/consistency/mtree/merkle.go
  • internal/infra/cdc/listen.go
  • tests/integration/cdc_init_ordering_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/integration/cdc_init_ordering_test.go
  • internal/consistency/mtree/merkle.go

Comment thread internal/infra/cdc/listen.go
processReplicationStream's non-continuous tail leaked repair_mode when
any step between Set(true) and Commit returned early — the session GUC
persists across SQL ROLLBACK, so the pooled connection went back
poisoned and the next borrower's writes silently did not replicate.

Switch to pool.Acquire: defer Set(false) on the borrowed *pgxpool.Conn
runs before Release, on every path.

flushMetadata and MtreeInit Phase C share the shape; tracked separately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@danolivo danolivo force-pushed the ace-186 branch 2 times, most recently from 6bb524b to dbd3724 Compare May 19, 2026 09:35
- flushMetadata (listen.go) and MtreeInit Phase C (merkle.go): port to
  the borrowed-*pgxpool.Conn pattern from Site 1, so defer Set(false)
  runs on the live session before Release. flushMetadata is on the
  periodic+shutdown path and was the highest-leak remaining site.

- Guard scope (listen.go): clarify the pub_commit_lsn check is a
  tripwire for partial-state-on-upgrade and narrow cross-node leaks,
  not a general leak detector — the real defense is repset exclusion
  plus repair_mode wrapping every metadata write.

- Test timing (cdc_init_ordering_test.go): bump
  assertSentinelDoesNotPropagate's window from 3 s to 10 s for slow CI.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/integration/cdc_init_ordering_test.go (1)

184-186: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale comment: mentions "3 s window" but code uses 10 seconds.

The comment references the original 3-second timeout, but the deadline was bumped to 10 seconds per prior review feedback.

📝 Suggested fix
 // assertSentinelDoesNotPropagate writes a sentinel start_lsn on n1 and
-// verifies it never appears on n2 within a 3 s window. Under bug 2 the
+// verifies it never appears on n2 within a 10 s window. Under bug 2 the
 // sentinel would propagate via Spock apply within seconds.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/integration/cdc_init_ordering_test.go` around lines 184 - 186, Update
the stale comment above assertSentinelDoesNotPropagate to reflect the current 10
second timeout (instead of "3 s window"); locate the comment that mentions "3 s
window" in the assertSentinelDoesNotPropagate test and change it to state "10 s
window" or "10-second window" so it matches the test's actual deadline.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tests/integration/cdc_init_ordering_test.go`:
- Around line 184-186: Update the stale comment above
assertSentinelDoesNotPropagate to reflect the current 10 second timeout (instead
of "3 s window"); locate the comment that mentions "3 s window" in the
assertSentinelDoesNotPropagate test and change it to state "10 s window" or
"10-second window" so it matches the test's actual deadline.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2d4b8b7-a44a-434f-9397-23eb7b69ae3e

📥 Commits

Reviewing files that changed from the base of the PR and between 5862fa7 and 5f50b9a.

📒 Files selected for processing (6)
  • db/queries/queries.go
  • db/queries/templates.go
  • internal/consistency/mtree/merkle.go
  • internal/infra/cdc/listen.go
  • internal/infra/cdc/setup.go
  • tests/integration/cdc_init_ordering_test.go

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