Skip to content

PHOENIX-7846 Bound rotation replay cost for large commit batches#2469

Open
tkhurana wants to merge 1 commit into
apache:PHOENIX-7562-feature-newfrom
tkhurana:PHOENIX-7562-feature-new
Open

PHOENIX-7846 Bound rotation replay cost for large commit batches#2469
tkhurana wants to merge 1 commit into
apache:PHOENIX-7562-feature-newfrom
tkhurana:PHOENIX-7562-feature-new

Conversation

@tkhurana
Copy link
Copy Markdown
Contributor

@tkhurana tkhurana commented May 11, 2026

Summary

  • When a replication log block fills up during append(), the writer implicitly syncs (flushes + closes the block). This change propagates that implicit-sync signal back to ReplicationLog.append() so it can clear currentBatch, acknowledging that all records up to that point are durable.
  • Without this fix, log rotation replays the entire inter-sync window (all records since the last explicit sync()) even though most of those records were already durably written via block-full syncs. For large commit batches this means replay cost grows with batch size instead of being bounded by the block size.
  • With this fix, rotation replay cost is bounded by the block size regardless of how large the commit batch is.
  • The LogFile.Writer.append() return type changes from void to booleantrue when an implicit block-full sync occurred, false when the record was buffered only.

Test plan

  • New unit test testBlockFullSyncOnAppendReducesReplayOnRotation in ReplicationLogGroupTest verifies that the number of replayed appends after rotation is strictly less than the total number of records written, confirming block-full clearing bounds replay.
  • Existing ReplicationLogGroupTest and ReplicationLogIT suites pass.
  • mvn spotless:apply passes.

@tkhurana tkhurana requested a review from apurtell May 11, 2026 21:57
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