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

CI Failure (partitions_rebalanced times out) in ScalingUpTest.test_adding_nodes_to_cluster #7418

Closed
dlex opened this issue Nov 22, 2022 · 19 comments · Fixed by #7698 or #9947
Closed
Assignees
Labels
area/tests ci-failure ci-ignore Automatic ci analysis tools ignore this issue do-not-reopen kind/bug Something isn't working

Comments

@dlex
Copy link
Contributor

dlex commented Nov 22, 2022

https://buildkite.com/redpanda/redpanda/builds/18876#01849c1f-24b8-447e-956d-2b6f080f625b

Module: rptest.tests.scaling_up_test
Class:  ScalingUpTest
Method: test_adding_nodes_to_cluster
Arguments:
{
  "partition_count": 1
}
test_id:    rptest.tests.scaling_up_test.ScalingUpTest.test_adding_nodes_to_cluster.partition_count=1
status:     FAIL
run time:   1 minute 2.276 seconds


    TimeoutError('')
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/ducktape/tests/runner_client.py", line 135, in run
    data = self.run_test()
  File "/usr/local/lib/python3.10/dist-packages/ducktape/tests/runner_client.py", line 227, in run_test
    return self.test_context.function(self.test)
  File "/usr/local/lib/python3.10/dist-packages/ducktape/mark/_mark.py", line 476, in wrapper
    return functools.partial(f, *args, **kwargs)(*w_args, **w_kwargs)
  File "/root/tests/rptest/services/cluster.py", line 35, in wrapped
    r = f(self, *args, **kwargs)
  File "/root/tests/rptest/tests/scaling_up_test.py", line 119, in test_adding_nodes_to_cluster
    self.wait_for_partitions_rebalanced(total_replicas=total_replicas,
  File "/root/tests/rptest/tests/scaling_up_test.py", line 70, in wait_for_partitions_rebalanced
    wait_until(partitions_rebalanced,
  File "/usr/local/lib/python3.10/dist-packages/ducktape/utils/util.py", line 57, in wait_until
    raise TimeoutError(err_msg() if callable(err_msg) else err_msg) from last_exception
ducktape.errors.TimeoutError

The test is trying to balance 20 partition replicas, 16 of them of __consumer_offsets and 4 of a regular topic. The success criteria is number_of_replicas_per_node ∊ number_of_replicas / number_of_nodes ± 20% (here]. This translates to expected range: [5.333333333333334,8.0] (which is actually an exclusive range despite of square brackets logged).

The distribution of replicas per node the cluster settles with is

replicas per node: {1: 6, 2: 6, 3: 8}

This is totally normal since #5460, because there are two different topics in two disctinct domains being balanced, domain 0 settles with the distribution of [1,1,2] and domain -1 also allocates the remainder of replicas on node 3.

The test needs to be adjusted either to test balancing of partitions that belong to the same domain, or allow for corner cases like this.

@dlex dlex added kind/bug Something isn't working area/tests ci-failure labels Nov 22, 2022
@dlex dlex self-assigned this Nov 22, 2022
@jcsp
Copy link
Contributor

jcsp commented Nov 22, 2022

@dlex
Copy link
Contributor Author

dlex commented Nov 23, 2022

@mmaslankaprv I think f0f683b is unrelated to this issue, this one is not about timeouts: the cluster comes to a stable replicas balance in ~5s out of 30s timeout and replica distribution never improves after that.

@dlex
Copy link
Contributor Author

dlex commented Nov 23, 2022

@dlex dlex reopened this Nov 23, 2022
@jcsp
Copy link
Contributor

jcsp commented Nov 23, 2022

Two more today:

FAIL test: ScalingUpTest.test_adding_nodes_to_cluster.partition_count=1 (2/47 runs)
failure at 2022-11-22T12:51:49.347Z: TimeoutError('')
on (amd64, container) in job https://buildkite.com/redpanda/redpanda/builds/18914#01849ed1-f732-4647-9c49-d36c17a01e7a
failure at 2022-11-22T15:29:01.731Z: TimeoutError('')
on (amd64, container) in job https://buildkite.com/redpanda/redpanda/builds/18919#01849f4c-57cb-4516-b76b-37128ac44ad9

@jcsp
Copy link
Contributor

jcsp commented Dec 1, 2022

andijcr pushed a commit to andijcr/redpanda that referenced this issue Dec 3, 2022
Scaling up tests was recently parametrized with partition count. For the
large partition count it is not enough to wait 30 seconds for the
partitions to be rebalanced, especially for the slow debug builds.

Fixes: redpanda-data#7418

Signed-off-by: Michal Maslanka <michal@redpanda.com>
@rystsov
Copy link
Contributor

rystsov commented Dec 11, 2022

mmaslankaprv added a commit to mmaslankaprv/redpanda that referenced this issue Dec 12, 2022
Changed the condition validating if partition replicas are rebalanced to
include the range boundaries.

Fixes: redpanda-data#7418

Signed-off-by: Michal Maslanka <michal@redpanda.com>
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Dec 13, 2022
Changed the condition validating if partition replicas are rebalanced to
include the range boundaries.

Fixes: redpanda-data#7418

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit ab6d23d)
dlex added a commit to dlex/redpanda that referenced this issue Dec 14, 2022
The assessment whether partitions are balanced were done by comparing
the number of partitions in each node with the average target ±20%. This
way went broken with the introduction of partition balancing domains.
The criteria is changed by this commit to make sure that the number of
partitions across noded is levelled within a scope of each domain
separately. Levelled means that min and max # of replicas differ by 1
at most.
Re redpanda-data#7418
dlex added a commit to dlex/redpanda that referenced this issue Dec 14, 2022
The assessment whether partitions are balanced were done by comparing
the number of partitions in each node with the average target ±20%. This
way went broken with the introduction of partition balancing domains.
The criteria is changed by this commit to make sure that the number of
partitions across noded is levelled within a scope of each domain
separately. Levelled means that min and max # of replicas differ by 1
at most.
Re redpanda-data#7418
@NyaliaLui NyaliaLui reopened this Mar 17, 2023
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Mar 31, 2023
Scaling up tests was recently parametrized with partition count. For the
large partition count it is not enough to wait 30 seconds for the
partitions to be rebalanced, especially for the slow debug builds.

Fixes: redpanda-data#7418

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit f0f683b)
@Lazin
Copy link
Contributor

Lazin commented Apr 6, 2023

dlex added a commit to dlex/redpanda that referenced this issue Apr 11, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Apr 11, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.

(cherry picked from commit b0d13af)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Apr 12, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.

(cherry picked from commit b0d13af)
@dlex
Copy link
Contributor Author

dlex commented Apr 13, 2023

There are corner cases that still give almost the same failure, handled by #10024

dlex added a commit to dlex/redpanda that referenced this issue Apr 19, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.

(cherry picked from commit b0d13af)
dlex added a commit to dlex/redpanda that referenced this issue Apr 19, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.

(cherry picked from commit b0d13af)
ballard26 pushed a commit to ballard26/redpanda that referenced this issue May 9, 2023
Partitions in each allocation domain are balanced separately since redpanda-data#5460.
This change evaluates whether the partitions are balanced well enough
within each of the allocation domains.

How topics are assigned to allocation domains is currently hardcoded:
__consumer_offsets belong to -1, all the rest belong to 0. If that
becomes more complicated, there should be a better way to determine
allocation domain association than this.

The ±20% range rule is preserved for each domain, but is somewhat relaxed
by rounding the boundary values outwards. This is required to handle small
partition counts, e.g. 3 partitions for 2 nodes would otherwise give range
of [1.2, 1.8] which no integer value will satisfy; the rounding makes
that range [1, 2] instead.

Fixes redpanda-data#7418.
@michael-redpanda
Copy link
Contributor

@dlex
Copy link
Contributor Author

dlex commented May 25, 2023

https://buildkite.com/redpanda/redpanda/builds/29872#018851b3-5ba0-4acf-ac99-63298506a279

This is the case of [1,1,2] distribution

replicas per domain per node: {-1: {1: 5, 2: 5, 3: 6}, 0: {1: 1, 2: 1, 3: 2}

moving over to #10024

@rystsov rystsov reopened this Sep 3, 2023
@rystsov
Copy link
Contributor

rystsov commented Sep 3, 2023

Please do not reopen this issue; if you feel like want to create a new issue and link this one as a reference

@rystsov rystsov closed this as completed Sep 3, 2023
@rystsov rystsov added do-not-reopen ci-ignore Automatic ci analysis tools ignore this issue labels Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment