Skip to content

Fix subscription prefetch wakeups for late replicated WAL entries - #19194

Open
Caideyipi wants to merge 2 commits into
masterfrom
fix/subscription-remote-wal-wakeup
Open

Caideyipi wants to merge 2 commits into
masterfrom
fix/subscription-remote-wal-wakeup

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Replicated WAL entries can arrive after a subscription prefetch worker becomes idle without advancing the local WAL search index or entering the realtime queue. Repeated polls can then stay empty until another event wakes the worker.

Wake a bound idle prefetch worker after an empty poll, with a per-queue 100 ms limit enforced by a monotonic-clock CAS. Preserve the initialization, seek, close, and executor-binding guards. Add regression tests for late remote-entry delivery and acknowledgement with zero local WAL gap, and for suppression immediately before the wakeup interval and grant at its boundary.

Validation

At commit 3a343faaff65424068f357819ecfe97c8a41ca9d:

  • Clean reactor run of ConsensusPrefetchingQueueSeekTest: 11 tests passed.
  • Clean local reactor run of both newly added tests: 2 tests passed; all 28 modules succeeded, with 482/482 Maven goals executed and no build-cache restores.
  • Spotless and git diff --check passed.

The full test suite and distributed integration tests have not been run on this commit.


This PR has:

  • been self-reviewed, including concurrent read and write paths.
  • added comments explaining why the idle worker needs another wakeup.
  • added unit tests for late remote WAL delivery and the wakeup interval boundary.

Key changed/added classes
  • ConsensusPrefetchingQueue
  • ConsensusPrefetchingQueueSeekTest

Wake an existing idle prefetch task after an empty poll so replicated WAL entries can be discovered without another local write. Preserve initialization, seek, lifecycle and executor-binding guards. Add a regression covering delivery and acknowledgement without advancing the local WAL cursor.
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.79%. Comparing base (36c35f6) to head (3a343fa).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...on/broker/consensus/ConsensusPrefetchingQueue.java 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19194      +/-   ##
============================================
- Coverage     48.80%   48.79%   -0.01%     
  Complexity      674      674              
============================================
  Files          5574     5574              
  Lines        412836   412845       +9     
  Branches      54448    54452       +4     
============================================
- Hits         201480   201458      -22     
- Misses       211356   211387      +31     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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