Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
  • Loading branch information
ztlpn committed May 14, 2024
1 parent ac62b3b commit 83f0d44
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/rptest/tests/end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self,

def start_redpanda(self,
num_nodes=1,
num_started_nodes=None,
extra_rp_conf=None,
si_settings=None,
environment=None,
Expand Down Expand Up @@ -122,7 +123,11 @@ def start_redpanda(self,
self.redpanda._installer.install(self.redpanda.nodes,
version_to_install)

self.redpanda.start(auto_assign_node_id=new_bootstrap,
started_nodes = None
if num_started_nodes is not None:
started_nodes = self.redpanda.nodes[:num_started_nodes]
self.redpanda.start(nodes=started_nodes,
auto_assign_node_id=new_bootstrap,
omit_seeds_on_idx_one=not new_bootstrap)
if version_to_install and install_opts.num_to_upgrade > 0:
# Perform the upgrade rather than starting each node on the
Expand Down
59 changes: 59 additions & 0 deletions tests/rptest/tests/partition_balancer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,3 +1142,62 @@ def test_transfer_controller_leadership(self):
target_id=transfer_to_idx)

self.wait_until_ready()

@skip_debug_mode
@cluster(num_nodes=7, log_allow_list=CHAOS_LOG_ALLOW_LIST)
def test_rebalance_finish(self):
self.start_redpanda(num_nodes=5,
num_started_nodes=3,
new_bootstrap=True,
extra_rp_conf={
"partition_autobalancing_mode": "node_add",
})
self.topic = TopicSpec(partition_count=50)
self.client().create_topic(self.topic)

self.start_producer(1)
self.start_consumer(1)
self.await_startup()

seed_nodes = self.redpanda.nodes[:3]
self.redpanda.restart_nodes(
seed_nodes,
auto_assign_node_id=True,
omit_seeds_on_idx_one=False,
override_cfg_params={"recovery_mode_enabled": True})

joiner_nodes = self.redpanda.nodes[3:]
for node in joiner_nodes:
self.redpanda.start_node(node,
auto_assign_node_id=True,
omit_seeds_on_idx_one=False)
self.redpanda.wait_for_membership(first_start=False)

admin = Admin(self.redpanda)

admin.transfer_leadership_to(namespace='redpanda',
topic='controller',
partition=0,
target_id=self.redpanda.node_id(
joiner_nodes[0]))

self.wait_until_status(lambda s: s["status"] == "stalled")

partition_counts = [
len(admin.get_partitions(node=n)) for n in joiner_nodes
]
self.logger.info(f"FFF1 partition counts: {partition_counts}")

# restart in normal mode
self.redpanda.restart_nodes(seed_nodes, auto_assign_node_id=True)
self.redpanda.wait_for_membership(first_start=False)

self.wait_until_ready()

partition_counts = [
len(admin.get_partitions(node=n)) for n in self.redpanda.nodes
]
self.logger.info(f"FFF2 partition counts: {partition_counts}")

self.run_validation(min_records=100,
consumer_timeout_sec=CONSUMER_TIMEOUT)

0 comments on commit 83f0d44

Please sign in to comment.