Sega76 commented on a change in pull request #8385:
URL: https://github.com/apache/ignite/pull/8385#discussion_r596644186



##########
File path: 
modules/ducktests/tests/ignitetest/tests/two_phased_rebalanced_test.py
##########
@@ -0,0 +1,282 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+This module contains Cellular Affinity tests.
+"""
+import math
+from typing import List
+from ducktape import errors
+from ducktape.cluster.cluster import ClusterNode
+from ignitetest.services.utils.ignite_aware import IgniteAwareService
+
+from ignitetest.services.utils.ignite_configuration.cache import 
CacheConfiguration, Affinity
+
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.utils.control_utility import ControlUtility
+from ignitetest.services.utils.ignite_configuration import 
IgniteConfiguration, DataStorageConfiguration
+from ignitetest.services.utils.ignite_configuration.data_storage import 
DataRegionConfiguration
+from ignitetest.services.utils.ignite_configuration.discovery import 
from_ignite_cluster
+from ignitetest.services.utils.util import copy_file_to_dest
+from ignitetest.utils import cluster, ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import IgniteVersion, DEV_BRANCH, LATEST_2_9, 
LATEST_2_8
+
+NUM_NODES_CELL = 4
+
+NUM_CELL = 2
+
+ATTRIBUTE = "CELL"
+
+CACHE_NAME = "test-cache"
+
+
+# pylint: disable=W0223
+class TwoPhasedRebalancedTest(IgniteTest):
+    """
+    Two-phase rebalancing test case.
+    """
+    # pylint: disable=R0914
+    @cluster(num_nodes=(NUM_NODES_CELL * NUM_CELL) + 1)
+    @ignite_versions(str(DEV_BRANCH), str(LATEST_2_9), str(LATEST_2_8))
+    def two_phased_rebalancing_test(self, ignite_version):
+        """
+        Test case of two-phase rebalancing.
+        Preparations.
+            1. Start cells.
+            2. Load data to cache with the mentioned above affinity function.
+            3. Delete 80% of data and measure PDS size on all nodes.
+        Phase 1.
+            1. Stop two nodes in each cell, total a half of all nodes and 
clean PDS.
+            2. Start cleaned node with preservance of consistent id and cell 
attributes.
+            3. Wait for the rebalance to complete.
+        Phase 2.
+            Run steps 1-3 of Phase 1 on the other half of the cluster.
+        Verifications.
+            1. Check that PDS size reduced (compare to step 3)
+            2. Check data consistency (idle_verify --dump)
+        """
+        config = IgniteConfiguration(version=IgniteVersion(ignite_version),
+                                     data_storage=DataStorageConfiguration(
+                                         
default=DataRegionConfiguration(persistent=True), checkpoint_frequency=30000),
+                                     caches=[CacheConfiguration(
+                                         name=CACHE_NAME, backups=2, 
affinity=Affinity(),
+                                         indexed_types=['java.lang.Long', 
'byte[]'])],
+                                     
metric_exporter='org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi')
+
+        cluster_size = len(self.test_context.cluster)

Review comment:
        We can set the cluster size through globals and then more cells will be 
used in the test




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to