Skip to content

Restore replay queue behavior#398

Open
mason-sharp wants to merge 4 commits intomainfrom
task/SPOC-475/revert-replay-queue
Open

Restore replay queue behavior#398
mason-sharp wants to merge 4 commits intomainfrom
task/SPOC-475/revert-replay-queue

Conversation

@mason-sharp
Copy link
Member

No longer make the queue size unlimited.

Also increase spock.exception_replay_queue_size default from 4MB to 16MB.

More improvements will be done in the future.

…orker restarts on overflow."

This reverts commit 9cbbffc.
GUC_UNIT_MB causes spock_replay_queue_size to be stored internally in
KB, but apply_replay_bytes accumulates in bytes. Multiply by 1024 to
compare in the same units, restoring the intended 4MB default threshold.
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37940b0c-d973-4535-a768-70774ddd72a3

📥 Commits

Reviewing files that changed from the base of the PR and between 564f3eb and 2618c3f.

📒 Files selected for processing (3)
  • include/spock.h
  • src/spock.c
  • src/spock_apply.c

📝 Walkthrough

Walkthrough

The replay queue variable declaration removes its deprecated marker and is reclassified as active. Configuration changes increase the default queue size from 4 to 16 and update descriptive text. Overflow handling logic is implemented with bounded byte limits and exception-triggered worker restart.

Changes

Cohort / File(s) Summary
Declaration and Configuration Updates
include/spock.h, src/spock.c
Removes "deprecated" comments from spock_replay_queue_size declaration and GUC definition. Reclassifies parameter as active with updated descriptive text and increases default value from 4 to 16.
Overflow Tracking and Handling
src/spock_apply.c
Introduces apply_replay_overflow flag to detect when replay queue byte usage exceeds the configured limit. Implements bounded queue logic in WAL message processing, immediate entry cleanup on overflow, and exception handling that triggers worker restart when overflow occurs.

Poem

🐰 Whispers of a coding hare:

No more deprecated, the queue takes flight,
With overflow guards and bounds held tight,
Four became sixteen, a leap so grand,
The replay stream flows as we planned! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Restore replay queue behavior' accurately captures the main objective: reintroducing a fixed replay queue size mechanism that was previously removed, as evidenced by all file changes revolving around bounded-queue enforcement and overflow handling.
Description check ✅ Passed The description clearly relates to the changeset by identifying the core changes: stopping unlimited queue sizing and increasing the default exception_replay_queue_size, both of which are directly reflected in the code modifications across all three files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 task/SPOC-475/revert-replay-queue

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.

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.

1 participant