Skip to content

Fix unsubscribe failures when DataNodes are offline - #19222

Open
Caideyipi wants to merge 1 commit into
masterfrom
fix/subscription-drop-offline-datanodes
Open

Caideyipi wants to merge 1 commit into
masterfrom
fix/subscription-drop-offline-datanodes

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Unsubscribe fails when metadata pushes encounter an unavailable registered DataNode. Allow unsubscribe execution and rollback to tolerate explicitly marked transport failures only when the DataNode is Unknown or Stopped. Keep metadata rejections, protocol/application errors, local dispatch errors, and failures from online nodes as failures. Other consumer-group operations retain their existing failure semantics.

For example, with consumer c in group g subscribed to topic t, stop DN2 and wait until it is marked offline, then unsubscribe c from t. Previously, a connection failure while dropping the subscription Pipe or updating the consumer group caused unsubscribe to fail. With this change, unsubscribe can complete on the available nodes; DN2 receives the current metadata through the existing synchronization path after reconnecting. Failed consumer-group pushes are recorded by the ready tracker before transport failures are filtered.

Validation

  • Pre-review local validation: an isolated clean-source build succeeded and 24 targeted unit tests passed, including all newly added tests.
  • Independent workspace re-review completed with no confirmed actionable findings. The published source matches that reviewed snapshot.
  • Publication checks: clean candidate worktree, whitespace checks passed, and no merge conflicts with the refreshed master.
  • Real-cluster kill/rejoin integration testing has not been run.

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths.
Key changed/added classes

DataNodeTransportFailureUtils, PipePushMetaRPCHandler, ConsumerGroupPushMetaRPCHandler, ConfigNodeProcedureEnv, AlterConsumerGroupProcedure, and DropSubscriptionProcedure.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 23.59551% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.89%. Comparing base (6620933) to head (33b0eea).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...cription/consumer/AlterConsumerGroupProcedure.java 0.00% 30 Missing ⚠️
...iption/subscription/DropSubscriptionProcedure.java 0.00% 14 Missing ⚠️
...de/client/async/DataNodeTransportFailureUtils.java 50.00% 13 Missing ⚠️
...ent/async/handlers/rpc/PipePushMetaRPCHandler.java 0.00% 4 Missing ⚠️
.../subscription/ConsumerGroupPushMetaRPCHandler.java 0.00% 4 Missing ⚠️
...cription/AbstractOperateSubscriptionProcedure.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19222      +/-   ##
============================================
+ Coverage     48.87%   48.89%   +0.01%     
  Complexity      689      689              
============================================
  Files          5588     5589       +1     
  Lines        413425   413479      +54     
  Branches      54525    54547      +22     
============================================
+ Hits         202074   202156      +82     
+ Misses       211351   211323      -28     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant