Skip to content

[v25.3.x] cluster/health: use kafka high watermark in partition_status - #30950

Merged
bartoszpiekny-redpanda merged 1 commit into
v25.3.xfrom
backport-pr-30873-v25.3.x-463
Jul 1, 2026
Merged

[v25.3.x] cluster/health: use kafka high watermark in partition_status#30950
bartoszpiekny-redpanda merged 1 commit into
v25.3.xfrom
backport-pr-30873-v25.3.x-463

Conversation

@bartoszpiekny-redpanda

@bartoszpiekny-redpanda bartoszpiekny-redpanda commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Backport of PR #30873

  • Command: git cherry-pick -x f4352ad
  • Commits backported: 1
  • Conflicts resolved: 2
  • Commits skipped (already on target): 0
  • Backport branch: backport-pr-30873-v25.3.x-463

Note: be aware that this fix won't be ported to v25.2.x as high_watermark on this branch is already cloud-aware.

Conflict details

  • f4352ad (tests/rptest/tests/consumer_group_test.py): import-list conflict in the rptest.services.redpanda import block — the target branch already imports RedpandaService, while the cherry-picked commit adds get_cloud_storage_type. Resolved by keeping both imports.
  • f4352ad (tests/rptest/tests/read_replica_e2e_test.py): the commit extracts a ReadReplicaE2EBase base class out of TestReadReplicaService, but the upstream diff also assumed read-replica test infrastructure that is not present on this branch (CrossRegionRRRTestMark/cross_region_rrr_test, the ReadReplicaSourceMode mode parameter, and cloud_topics_long_term_flush_interval). Resolved by introducing ReadReplicaE2EBase adapted to the target branch's existing structure (without the cloud-topics / cross-region infra) and by adding a replication_factor parameter to _setup_read_replica, which the new ReadReplicaConsumerLagTest requires.

build_partition_status() reported a partition's high watermark as
from_log_offset(p.high_watermark()), the raw local-log position. For a
read replica the local raft log holds only the synced manifest (no data
batches), so this translates to ~0 in the Kafka offset space instead of
the real cloud high watermark (next_cloud_offset).

The consumer-group lag metric reads this health-report HWM, so
redpanda_kafka_consumer_group_lag_{max,sum} collapsed to 0 for
read-replica topics regardless of the committed offset, hiding real
backlog. The Kafka-visible HWM (rpk / list_offsets) was unaffected
because it already goes through kafka_high_watermark().

Use cluster::kafka_high_watermark(p) so high_watermark is cloud-aware
and consistent with the log_start_offset set alongside it. For
non-read-replica partitions the value is unchanged.

Covered by a ducktape test
(ReadReplicaConsumerLagTest.test_group_lag_metrics_read_replica in
consumer_group_test.py): it pins the committed offset to 0 so the
reported lag reduces to the health-report HWM, then asserts that lag
equals the cloud-visible HWM. The read-replica setup helpers were
extracted from TestReadReplicaService into a ReadReplicaE2EBase base
class so the new test can reuse them without inheriting the e2e suite.

Follow-up to CORE-16393.

(cherry picked from commit f4352ad)
@bartoszpiekny-redpanda
bartoszpiekny-redpanda merged commit 0c25e69 into v25.3.x Jul 1, 2026
20 checks passed
@bartoszpiekny-redpanda
bartoszpiekny-redpanda deleted the backport-pr-30873-v25.3.x-463 branch July 1, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants