Skip to content

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

Closed
github-actions[bot] wants to merge 1 commit intorelease/v25.1.xfrom
backport/release/v25.1.x/pr-1234
Closed

[release/v25.1.x] topic: allow finalizer removal when broker is unreachable#1255
github-actions[bot] wants to merge 1 commit intorelease/v25.1.xfrom
backport/release/v25.1.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.1.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.1.x/pr-1234 branch from f0605d1 to 9002b8f Compare February 3, 2026 17:46
@birdayz birdayz closed this Feb 3, 2026
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.

1 participant