-
Notifications
You must be signed in to change notification settings - Fork 749
cluster/observability: fix empty partition in decom / reconfiguration status ouputs #29047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
29c6050
cluster/types: fix missing entry in serde_fields
bharathv 1242014
cluster/types: update ostream op
bharathv f8c76ea
cluster/controller_api: wire up partition_leaders_table
bharathv cab8675
controller/api: introduce get_partition_leader_reconciliation_state
bharathv bfd9761
controller/api: fetch reconfiguration states from leader
bharathv da299be
controller/api: parallelize reconcliation state fetches
bharathv aa11692
cluster/decomm_status: simple test for validating status output
bharathv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -438,6 +438,61 @@ def test_decommissioning_working_node( | |
| if not delete_topic: | ||
| self.verify() | ||
|
|
||
| @cluster(num_nodes=6) | ||
| def test_decommission_status(self): | ||
| self.start_redpanda() | ||
| self._create_topics(replication_factors=[3]) | ||
| self.start_producer() | ||
| to_decommission = random.choice(self.redpanda.nodes) | ||
| to_decommission_id = self.redpanda.node_id(to_decommission) | ||
| self.logger.info( | ||
| f"decommissioning node: {to_decommission_id}", | ||
| ) | ||
| # Block recovery to ensure decommissioning takes some time | ||
| # and we see some status in the middle of decommissioning | ||
| self._set_recovery_rate(0) | ||
| self._decommission(to_decommission_id) | ||
|
|
||
| def validate_decommission_status(): | ||
| def check_decommission_status(rpc_node: ClusterNode): | ||
| status = self.admin.get_decommission_status( | ||
| id=to_decommission_id, node=rpc_node | ||
| ) | ||
| finished = status["finished"] | ||
| replicas_left = status["replicas_left"] | ||
| partition_meta = [] | ||
| for p in status.get("partitions", []): | ||
| if p["topic"] != self._topic: | ||
| # We are only producing data to self._topic | ||
| continue | ||
| has_valid_meta = ( | ||
| p["partition_size"] > 0 and p["bytes_left_to_move"] > 0 | ||
| ) | ||
| if not has_valid_meta: | ||
| self.logger.debug( | ||
| f"partition {p} is not reporting valid metadata" | ||
| ) | ||
| partition_meta.append(has_valid_meta) | ||
| return ( | ||
| not finished | ||
| and replicas_left > 0 | ||
| and partition_meta | ||
| and all(partition_meta) | ||
| ) | ||
|
|
||
| return all(check_decommission_status(n) for n in self.redpanda.nodes) | ||
|
|
||
| self.redpanda.wait_until( | ||
| validate_decommission_status, | ||
| timeout_sec=30, | ||
| backoff_sec=1, | ||
| err_msg="Decommission status not reported as in_progress on all nodes", | ||
| retry_on_exc=True, | ||
| ) | ||
| self._set_recovery_rate(2 << 30) | ||
|
||
|
|
||
| self._wait_for_node_removed(to_decommission_id) | ||
|
|
||
| @cluster(num_nodes=6, log_allow_list=CHAOS_LOG_ALLOW_LIST) | ||
| def test_decommissioning_node_rf_1_replica(self): | ||
| self.start_redpanda() | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number
16for max concurrency should be extracted as a named constant or configuration parameter to make its purpose clear and allow easier tuning.