Skip to content

PHOENIX-7992 Add replay-side performance metrics for HA replication - #2607

Draft
Himanshu-g81 wants to merge 2 commits into
apache:PHOENIX-7562-feature-newfrom
Himanshu-g81:PHOENIX-7992
Draft

PHOENIX-7992 Add replay-side performance metrics for HA replication#2607
Himanshu-g81 wants to merge 2 commits into
apache:PHOENIX-7562-feature-newfrom
Himanshu-g81:PHOENIX-7992

Conversation

@Himanshu-g81

@Himanshu-g81 Himanshu-g81 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Adds six per-HA-group standby replay-side performance metrics (replay lag, pickup lag, mutations replayed + per-file, rename-failed count, slow-round count) for HA replication — new observability surface, no behavioral change.

Adds six standby replay-side performance metrics, each inheriting the
per-haGroup dimension from its metric source.

ReplicationLogDiscoveryReplay:
  - endToEndReplayLagMs (histogram): round-eligible -> replay finished
  - pickupLagMs (histogram): round-eligible -> file claimed (rename into
    the in-progress directory)

ReplicationLogDiscovery (shared base):
  - roundsExceedingRoundTime (counter): rounds whose new-file processing
    duration exceeded roundTimeMills

ReplicationLogProcessor:
  - mutationsReplayedCount (counter): replay throughput across all files
  - mutationsPerFile (histogram): per-file mutation count, recorded only
    for files that replayed at least one mutation so rotation-only files
    do not skew the distribution toward zero

ReplicationLogTracker:
  - markFileInProgressCollisionCount (counter): claim renames lost to a
    competing process, a strict subset of the request count

The lag metrics use the round-eligible instant (round end + waiting
buffer) as the zero reference, so they exclude the fixed built-in wait
rather than measuring raw file age.

Tests: metric-source plumbing for all six metrics, plus recording-site
tests for the collision metric (rename-loses vs rename-wins) and the
slow-round metric (fast round vs slow round).
Record pickupLag only on a file's first claim, skipping in-progress reclaims
that re-stamp the rename timestamp; anchor round-boundary files to the earlier
round in getRoundEligibleTime; and rename two counters to match what they
actually measure: mutationsReplayedCount -> successfulFileMutationsReplayedCount
and markFileInProgressCollisionCount -> markFileInProgressRenameFailedCount.
Adds ReplicationLogDiscoveryReplayProcessFileTest covering the eligibility math,
first-claim-only pickup lag, and mid-replay failure handling.
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.

2 participants