8000 test(inkless:switch): run the stale high watermark promotion test in phase 2 [KC-721] by giuseppelillo · Pull Request #854 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

test(inkless:switch): run the stale high watermark promotion test in phase 2 [KC-721] - #854

Merged
viktorsomogyi merged 1 commit into
mainfrom
giuseppelillo/kc-721-phase-2-stale-hw-promotion
Nov 5, 2026
Merged

viktorsomogyi merged 1 commit into
mainfrom
giuseppelillo/kc-721-phase-2-stale-hw-promotion

Conversation

@giuseppelillo
Copy link
Copy Markdown
Contributor

test_switched_leader_promotion_restores_stale_hw fails on main since
#849 (KC-636). The test sets unclean.leader.election.enable=true right
after the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.

The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.

The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with remote.storage.enable in the same alter as
diskless.enable, and it waits for classicPrefixInRemoteStorage before
it injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads __remote_log_metadata, which it needs to
serve the prefix from remote storage. The consumer must read every record
across the seal.

On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
maybeReconcileSwitchedLeader doesn't run in this test, and
testApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeader covers
it.

The change also removes _run_unclean_leader_election, which has no other
callers.

Testing

  • test_switched_leader_promotion_restores_stale_hw passes twice in ducker
    on main. The logs show phase 2 at seal 5000, a broker reload with high
    watermark 2500, a local log start offset of 5000, and 6000 records
    consumed.
  • make vale passes.

Assisted-by: Claude Opus 5.5

…phase 2 [KC-721]

`test_switched_leader_promotion_restores_stale_hw` fails on main since
#849 (KC-636). The test sets `unclean.leader.election.enable=true` right
after the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.

The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.

The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with `remote.storage.enable` in the same alter as
`diskless.enable`, and it waits for `classicPrefixInRemoteStorage` before
it injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads
`__remote_log_metadata`, which it needs to serve the prefix from remote
storage. The consumer must read every record across the seal.

On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
`maybeReconcileSwitchedLeader` doesn't run in this test, and
`testApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeader` covers
it.

The change also removes `_run_unclean_leader_election`, which has no other
callers.

## Testing

- `test_switched_leader_promotion_restores_stale_hw` passes twice in ducker
  on main. The logs show phase 2 at seal 5000, a broker reload with high
  watermark 2500, a local log start offset of 5000, and 6000 records
  consumed.
- `make vale` passes.

Assisted-by: Claude Opus 5.5
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the phase-2 stale high-watermark promotion test update.

No open issues 🎉

What changed in this PR

Updates the stale high-watermark promotion system test to run in switch phase 2, where remote storage holds the classic prefix. This adapts the test to the controller’s phase-1 unclean-election restrictions while preserving consumer coverage across the seal.

Changes:

  • Adds consolidation-cluster support, combined switch configuration, and phase-2 state polling.
  • Replaces network isolation and unclean election with ordered broker shutdowns and a single-replica restart.
  • Removes the unused unclean-election helper.
File Description
tests/​kafkatest/​tests/​inkless/​inkless_topic_switch_test.py Adds phase-2 test helpers and reworks stale-checkpoint recovery coverage to verify consumption across the classic prefix and diskless tail.

Review effort: Balanced

8000
@viktorsomogyi
viktorsomogyi merged commit 6074c06 into main Nov 5, 2026
9 checks passed
@viktorsomogyi
viktorsomogyi deleted the giuseppelillo/kc-721-phase-2-stale-hw-promotion branch November 5, 2026 13:18
gqmelo pushed a commit that referenced this pull request Nov 5, 2026
…phase 2 [KC-721] (#854)

`test_switched_leader_promotion_restores_stale_hw` fails on main since
#849 (KC-636). The test sets `unclean.leader.election.enable=true` right
after the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.

The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.

The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with `remote.storage.enable` in the same alter as
`diskless.enable`, and it waits for `classicPrefixInRemoteStorage` before
it injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads
`__remote_log_metadata`, which it needs to serve the prefix from remote
storage. The consumer must read every record across the seal.

On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
`maybeReconcileSwitchedLeader` doesn't run in this test, and
`testApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeader` covers
it.

The change also removes `_run_unclean_leader_election`, which has no other
callers.

## Testing

- `test_switched_leader_promotion_restores_stale_hw` passes twice in ducker
  on main. The logs show phase 2 at seal 5000, a broker reload with high
  watermark 2500, a local log start offset of 5000, and 6000 records
  consumed.
- `make vale` passes.

Assisted-by: Claude Opus 5.5
gqmelo pushed a commit that referenced this pull request Nov 5, 2026
…phase 2 [KC-721] (#854)

`test_switched_leader_promotion_restores_stale_hw` fails on main since
#849 (KC-636). The test sets `unclean.leader.election.enable=true` right
after the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.

The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.

The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with `remote.storage.enable` in the same alter as
`diskless.enable`, and it waits for `classicPrefixInRemoteStorage` before
it injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads
`__remote_log_metadata`, which it needs to serve the prefix from remote
storage. The consumer must read every record across the seal.

On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
`maybeReconcileSwitchedLeader` doesn't run in this test, and
`testApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeader` covers
it.

The change also removes `_run_unclean_leader_election`, which has no other
callers.

## Testing

- `test_switched_leader_promotion_restores_stale_hw` passes twice in ducker
  on main. The logs show phase 2 at seal 5000, a broker reload with high
  watermark 2500, a local log start offset of 5000, and 6000 records
  consumed.
- `make vale` passes.

Assisted-by: Claude Opus 5.5
gqmelo pushed a commit that referenced this pull request Nov 5, 2026
…phase 2 [KC-721] (#854)

`test_switched_leader_promotion_restores_stale_hw` fails on main since
#849 (KC-636). The test sets `unclean.leader.election.enable=true` right
after the seal commit, and the controller now rejects that config until
phase 2. The test cluster had no remote storage, so its switched partition
never left phase 1.

The old scenario can't happen in phase 1 anymore. There, the controller
elects only ISR members, and the old test needed unclean election to
promote a replica outside the ISR. In phase 2, remote storage holds the
prefix and the controller can elect any live replica. A replica with a
stale high watermark can still become leader there. This change reworks
the test to cover that case instead of removing it.

The test runs on a consolidation cluster with tiered storage on MinIO. It
switches with `remote.storage.enable` in the same alter as
`diskless.enable`, and it waits for `classicPrefixInRemoteStorage` before
it injects the stale high watermark checkpoint. The test stops the
promoted replica last instead of isolating it with a network partition.
It's then the last ISR member of the test topic and of the internal
topics, so the controller elects it without unclean election when it
restarts alone. It also leads
`__remote_log_metadata`, which it needs to serve the prefix from remote
storage. The consumer must read every record across the seal.

On main, the follower consolidation fetcher repairs the stale high
watermark before the promotion. The leader-side repair in
`maybeReconcileSwitchedLeader` doesn't run in this test, and
`testApplyDeltaRestoresStaleHwmWhenSwitchedFollowerBecomesLeader` covers
it.

The change also removes `_run_unclean_leader_election`, which has no other
callers.

## Testing

- `test_switched_leader_promotion_restores_stale_hw` passes twice in ducker
  on main. The logs show phase 2 at seal 5000, a broker reload with high
  watermark 2500, a local log start offset of 5000, and 6000 records
  consumed.
- `make vale` passes.

Assisted-by: Claude Opus 5.5
jeqo pushed a commit that referenced this pull request Nov 6, 2026
)

The 0.51 entry records the switch phase gates, the bounded consolidation prune, and their config, metric, and schema changes. The generator draft missed the new default of `inkless.consolidation.cleanup.interval.ms` and the broker and controller metrics that `metrics.rst` doesn't cover. Its `PostgresControlPlane` delta is documentation catch-up for metrics that 0.50 already registered.

The session logs record the cherry-pick of #823 through #854 to `inkless-4.1`, `inkless-4.2`, and `inkless-4.3`, the conflict resolutions, and the release-branch build fixes.

## Testing

- `make vale` reports no alerts.

Assisted-by: Claude Opus 5.5
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.

3 participants

0