Skip to content

[server] Add per-directory parallel follower recovery - #4915

Open
fxbing wants to merge 1 commit into
apache:mainfrom
fxbing:feature/20261027-parallel-follower-recovery
Open

fxbing wants to merge 1 commit into
apache:mainfrom
fxbing:feature/20261027-parallel-follower-recovery

Conversation

@fxbing

@fxbing fxbing commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Purpose

Closes #4914

Allow replicas to recover concurrently during follower transitions instead of processing every replica serially.

Brief change log

  • Add log.replica.follower-recovery.enabled (default false) and log.replica.follower-recovery.threads-per-data-dir (default 1). Enabled recovery uses temporary pools per actual data directory.
  • Serialize checkpoint snapshot capture and publication per directory to prevent stale snapshots from overwriting newer recovery points.
  • Add fetchers only after the batch succeeds. Drain accepted tasks and await executor termination before propagating failures or closing dependencies.

Tests

117 tests passed across eight related suites on Java 11:

./mvnw -pl fluss-server -am test \
  -Dtest=LogManagerTest,FollowerRecoveryExecutorTest,FollowerRecoveryTest,FollowerRecoveryShutdownTest,TabletServerShutdownTest,ReplicaManagerTest,ReplicaTest,ReplicaFetcherManagerTest \
  -Dsurefire.failIfNoSpecifiedTests=false

Coverage includes directory concurrency limits, serial fallback, failure and interruption handling, shutdown ordering, and log/writer-state recovery. Three checkpoint regressions fail without the fix, including unclean recovery with a corrupted retained segment.

Spotless, Checkstyle, RAT, and configuration documentation generation passed. The full repository suite and performance benchmarks were not run.

API and Format

Two new server configuration options; no public Java API, RPC, or storage format changes. Parallel recovery is disabled by default.

Documentation

Updated the configuration reference with both options, their defaults, and concurrency semantics.

Generative AI disclosure

  • Generative AI tools were used.

Generated-by: OpenAI Codex

OpenAI Codex assisted with implementation, tests, code review, and PR preparation.

Add opt-in batch-owned recovery pools with configurable threads per data directory and drain recovery before closing dependencies.

Serialize recovery checkpoint capture and publication per directory; cover concurrent truncation, crash recovery, failures and shutdown.
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.

[server] Support parallel follower recovery per data directory

1 participant