Skip to content

[metrics] Fix pendingRecords metric to return actual row count for primary key tables when lake tiering hasn't started#3059

Merged
luoyuxia merged 3 commits intoapache:mainfrom
beryllw:fix_pendingRecords
Apr 14, 2026
Merged

[metrics] Fix pendingRecords metric to return actual row count for primary key tables when lake tiering hasn't started#3059
luoyuxia merged 3 commits intoapache:mainfrom
beryllw:fix_pendingRecords

Conversation

@beryllw
Copy link
Copy Markdown
Contributor

@beryllw beryllw commented Apr 13, 2026

Purpose

Linked issue: close #xxx
Fix LAKE_PENDING_RECORDS metric for primary key tables when lake tiering hasn't started yet (getLakeLogEndOffset() < 0). Previously, it returned log size (highWatermark - startOffset) which doesn't reflect actual pending records for PK tables. Now returns materialized row count for PK tables.

Brief change log

Modified registerLakeTieringMetrics() in Replica.java to use getRowCount() for primary key tables when getLakeLogEndOffset() < 0, while keeping log size calculation for non-PK tables

Tests

API and Format

Documentation

@beryllw beryllw force-pushed the fix_pendingRecords branch 2 times, most recently from 65e6504 to 33dfb54 Compare April 13, 2026 01:37
@beryllw beryllw force-pushed the fix_pendingRecords branch from 33dfb54 to fbffc5d Compare April 14, 2026 08:26
@beryllw beryllw requested a review from luoyuxia April 14, 2026 08:51
…imary key tables when lake tiering hasn't started
@beryllw beryllw force-pushed the fix_pendingRecords branch from aa1b55a to 04c89da Compare April 14, 2026 09:10
@beryllw beryllw requested a review from luoyuxia April 14, 2026 09:29
Copy link
Copy Markdown
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@luoyuxia luoyuxia merged commit 70c9dd1 into apache:main Apr 14, 2026
10 of 12 checks passed
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