Skip to content

spock: revalidate dboid before registering a manager worker#480

Merged
mason-sharp merged 2 commits into
v5_STABLEfrom
SPOC_REPLIACA_FAILOVER
May 25, 2026
Merged

spock: revalidate dboid before registering a manager worker#480
mason-sharp merged 2 commits into
v5_STABLEfrom
SPOC_REPLIACA_FAILOVER

Conversation

@ibrarahmad
Copy link
Copy Markdown
Contributor

@ibrarahmad ibrarahmad commented May 24, 2026

Between the pg_database seq-scan and spock_worker_register() another backend can DROP DATABASE or set datconnlimit = -2, leaving the manager worker to FATAL during attach and sustaining a respawn loop under heavy tenant-DB churn.

SPOC-567

Between the pg_database seq-scan and spock_worker_register() another
backend can DROP DATABASE or set datconnlimit = -2, leaving the manager
worker to FATAL during attach and sustaining a respawn loop under
heavy tenant-DB churn.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0b9b3dd7-a8c6-4943-8ee7-5a70686c9116

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SPOC_REPLIACA_FAILOVER

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.

@ibrarahmad ibrarahmad requested a review from mason-sharp May 24, 2026 16:48
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

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.

@danolivo danolivo added the skip-test-nightly Skip this PR in the nightly TAP workflow label May 25, 2026
Comment thread tests/tap/t/103_manager_worker_dboid_race.pl Outdated
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 `@tests/tap/t/103_manager_worker_dboid_race.pl`:
- Line 104: The wait loop using waitpid($_, 0) for `@kids`; only waits but doesn't
assert child exit codes; change it to reap each child (using waitpid on each pid
from `@kids`) and assert that each exited cleanly by checking the Perl $? (or
WIFEXITED/WEXITSTATUS semantics), failing the test if any child returned a
non-zero/abnormal status so churn failures can't silently pass; update the block
that uses waitpid, `@kids` and $? to perform these checks and emit a failing
test/diagnostic when a child exit code is non-zero.
🪄 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: 04155753-9530-44de-8be3-c987b8a61b0b

📥 Commits

Reviewing files that changed from the base of the PR and between 769e2b8 and 179fd6f.

📒 Files selected for processing (3)
  • src/spock.c
  • tests/tap/schedule
  • tests/tap/t/103_manager_worker_dboid_race.pl

Comment thread tests/tap/t/103_manager_worker_dboid_race.pl
Reproduces the race that produced the FATAL respawn loop on tenant-DB
churn: six parallel CREATE/DROP DATABASE loops plus a fast-shutdown
mid-window of the postmaster. Asserts the new log content has zero
"FATAL: cannot connect to invalid database", zero "FATAL: database <oid>
does not exist", and zero "manager worker ... exiting with error". Wired
into the regular schedule so make check_prove picks it up.
@mason-sharp mason-sharp force-pushed the SPOC_REPLIACA_FAILOVER branch from 179fd6f to 221f101 Compare May 25, 2026 20:39
@mason-sharp mason-sharp merged commit b5bc358 into v5_STABLE May 25, 2026
6 checks passed
@mason-sharp mason-sharp deleted the SPOC_REPLIACA_FAILOVER branch May 25, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-test-nightly Skip this PR in the nightly TAP workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants