Skip to content
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

tests: shut down redpanda node after decom #5708

Merged
merged 2 commits into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions tests/rptest/tests/nodes_decommissioning_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,29 @@ def test_decommissioning_working_node(self):
self.await_startup()
admin = Admin(self.redpanda)

brokers = admin.get_brokers()
to_decommission = random.choice(brokers)
self.logger.info(f"decommissioning node: {to_decommission}", )
admin.decommission_broker(to_decommission['node_id'])
to_decommission = random.choice(self.redpanda.nodes)
to_decommission_id = self.redpanda.idx(to_decommission)
self.logger.info(f"decommissioning node: {to_decommission_id}", )
admin.decommission_broker(to_decommission_id)

# A node which isn't being decommed, to use when calling into
# the admin API from this point onwards.
survivor_node = self._not_decommissioned_node(
to_decommission['node_id'])
survivor_node = self._not_decommissioned_node(to_decommission_id)
self.logger.info(
f"Using survivor node {survivor_node.name} {self.redpanda.idx(survivor_node)}"
)

wait_until(lambda: self._node_removed(to_decommission['node_id'],
survivor_node),
timeout_sec=120,
backoff_sec=2)
wait_until(
lambda: self._node_removed(to_decommission_id, survivor_node),
timeout_sec=120,
backoff_sec=2)

# Stop the decommissioned node, because redpanda internally does not
# fence it, it is the responsibility of external orchestrator to
# stop the node they intend to remove.
# This can be removed when we change redpanda to prevent decommissioned nodes
# from responding to client Kafka requests.
self.redpanda.stop_node(to_decommission)

self.run_validation(enable_idempotence=False, consumer_timeout_sec=45)

Expand Down