Skip to content

[release/v25.3.x] topic: allow finalizer removal when broker is unreachable#1257

Merged
andrewstucki merged 1 commit intorelease/v25.3.xfrom
backport/release/v25.3.x/pr-1234
Feb 4, 2026
Merged

[release/v25.3.x] topic: allow finalizer removal when broker is unreachable#1257
andrewstucki merged 1 commit intorelease/v25.3.xfrom
backport/release/v25.3.x/pr-1234

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Feb 3, 2026

Backport

This will backport the following commits from main to release/v25.3.x:

Questions ?

Please refer to the Backport tool documentation

Topics were getting stuck in Terminating state when the Kafka broker
was unreachable (connection refused, DNS failure, etc.) or when
credentials were missing. The controller kept retrying forever,
blocking namespace deletion.

Fix by detecting non-recoverable connection errors during topic deletion
and allowing the finalizer to be removed. This handles:

- Missing credentials Secret or cloud secret (NotFound errors)
- Network dial errors (net.OpError - connection refused, DNS failures)
- Terminal client errors (SASL auth failures)
- Invalid cluster reference errors

Add isNetworkDialError() helper using errors.As to find net.OpError
in the error chain. Add unit tests covering various error wrapping
scenarios (direct, single-wrapped, double-wrapped).

Also adds operator.redpanda.com/allow-deletion annotation to force
topic deletion even when broker connectivity issues exist.

(cherry picked from commit 30cb82b)

# Conflicts:
#	operator/internal/controller/redpanda/resource_controller.go
@birdayz birdayz force-pushed the backport/release/v25.3.x/pr-1234 branch from 50abc91 to 9a3ef6a Compare February 3, 2026 17:41
@andrewstucki andrewstucki merged commit 8fee50f into release/v25.3.x Feb 4, 2026
10 checks passed
@andrewstucki andrewstucki deleted the backport/release/v25.3.x/pr-1234 branch February 4, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants