Skip to content

Fix subscription initialization retries for transient WAL reads - #18829

Open
Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/subscription-wal-init-retry
Open

Caideyipi wants to merge 1 commit into
apache:masterfrom
Caideyipi:fix/subscription-wal-init-retry

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

A transient NoSuchFileException during the initial region-progress WAL lookup was treated as a locate failure and thrown from poll, producing SUBSCRIPTION_POLL_ERROR (1904). This can interrupt consumers while a WAL filename is changing during rolling.

Carry an explicit RETRY_LATER decision for deferred reads and leave prefetch initialization dormant until a subsequent poll completes the lookup. Recovery frontiers and the replay cursor are installed only after a successful lookup. Confirmed retained WAL corruption remains a lookup failure, including scans that also encounter a temporarily unreadable live file.

The regression tests reproduce a file disappearing between directory listing and opening, repeated unreadable polls followed by recovery, retained corruption, and corruption followed by a deferred live-file read. Recovery checks verify that committed records are skipped and the remaining records replay exactly once without WAL gap increments.

Validation

  • The new tests reproduce two initialization exceptions before the fix; all four pass with the fix.
  • Related queue, seek, initialization, and WAL iterator tests: 75 tests, 0 failures, 0 errors, 1 optional performance test skipped.
  • English and Chinese full-reactor test compilation passed: mvn test-compile -DskipTests and mvn test-compile -DskipTests -P with-zh-locale.
  • The original 3C3D workload has not been rerun.

This PR has:

  • been self-reviewed.
  • added comments explaining the retry and corruption distinction.
  • added unit tests covering the new behavior.
Key changed/added classes

ConsensusPrefetchingQueue, ConsensusPrefetchingQueueInitializationTest

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