sanpwc commented on code in PR #4446: URL: https://github.com/apache/ignite-3/pull/4446#discussion_r1867581652
########## modules/catalog-compaction/src/integrationTest/java/org/apache/ignite/internal/catalog/compaction/ItCatalogCompactionTest.java: ########## @@ -51,14 +51,13 @@ import org.apache.ignite.network.ClusterNode; import org.apache.ignite.tx.Transaction; import org.apache.ignite.tx.TransactionOptions; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** * Integration tests to verify catalog compaction. */ -class ItCatalogCompactionTest extends ClusterPerClassIntegrationTest { +class ItCatalogCompactionTest extends ClusterPerTestIntegrationTest { Review Comment: What's the point in creating cluster per each test? ########## modules/partition-replicator/src/integrationTest/java/org/apache/ignite/internal/partition/replicator/ItReplicaLifecycleTest.java: ########## @@ -1252,8 +1254,10 @@ public CompletableFuture<Boolean> invoke( partitionRaftConfigurer, view -> new LocalLogStorageFactory(), ForkJoinPool.commonPool(), - t -> converter.get().apply(t) - ); + t -> converter.get().apply(t), + replicaGrpId -> metaStorageManager.get(ZoneRebalanceUtil.pendingPartAssignmentsKey((ZonePartitionId) replicaGrpId)) Review Comment: I'd rather use static import here in order to eliminate excessive ZoneRebalanceUtil. ########## modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/network/replication/ChangePeersAndLearnersAsyncReplicaRequest.java: ########## @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package org.apache.ignite.internal.partition.replicator.network.replication; + +import org.apache.ignite.internal.network.annotations.Transferable; +import org.apache.ignite.internal.partition.replicator.network.PartitionReplicationMessageGroup; +import org.apache.ignite.internal.replicator.message.PrimaryReplicaRequest; + +/** + * Request for performing {@link org.apache.ignite.internal.raft.service.RaftGroupService#changePeersAndLearnersAsync} on a primary replica. + */ +@Transferable(PartitionReplicationMessageGroup.CHANGE_PEERS_AND_LEARNERS_ASYNC_REPLICA_REQUEST) +public interface ChangePeersAndLearnersAsyncReplicaRequest extends PrimaryReplicaRequest { + /** New peers configuration to rebalance. */ + BinaryTupleMessage pendingAssignments(); Review Comment: Please consider using byte[] or ``` @Transferable(MessageGroup.ASSIGNMENTS_MESSAGE) public interface AssignmentsMessage extends NetworkMessage { ... } ``` if byte[] array is not convenient. ########## modules/placement-driver-api/src/testFixtures/java/org/apache/ignite/internal/placementdriver/TestPlacementDriver.java: ########## @@ -112,8 +112,29 @@ public Supplier<? extends ReplicaMeta> getPrimaryReplicaSupplier() { return this.primaryReplicaSupplier; } - public void setPrimaryReplicaSupplier(Supplier<? extends ReplicaMeta> primaryReplicaSupplier) { + /** + * Setter for a test primary replica supplier with {@code PRIMARY_REPLICA_ELECTED} event firing that is crucial for some tests internal + * logic that depends on the event handling. + * + * @param primaryReplicaSupplier The supplier that provides {@link TestReplicaMetaImpl} instance with a test primary replica meta + * information. + */ + public void setPrimaryReplicaSupplier(Supplier<? extends TestReplicaMetaImpl> primaryReplicaSupplier) { this.primaryReplicaSupplier = primaryReplicaSupplier; + + TestReplicaMetaImpl replicaMeta = primaryReplicaSupplier.get(); + + fireEvent( + PrimaryReplicaEvent.PRIMARY_REPLICA_ELECTED, + new PrimaryReplicaEventParameters( + 0, Review Comment: Is that ok to have 0 here? ########## modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/network/replication/ChangePeersAndLearnersReplicaRequest.java: ########## @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package org.apache.ignite.internal.partition.replicator.network.replication; + +import org.apache.ignite.internal.network.annotations.Transferable; +import org.apache.ignite.internal.partition.replicator.network.PartitionReplicationMessageGroup; +import org.apache.ignite.internal.replicator.message.PrimaryReplicaRequest; +import org.apache.ignite.internal.replicator.message.ReplicaRequest; + +/** + * Request for performing {@link org.apache.ignite.internal.raft.service.RaftGroupService#changePeersAndLearnersAsync} on a primary replica. + */ +@Transferable(PartitionReplicationMessageGroup.CHANGE_PEERS_AND_LEARNERS_REPLICA_REQUEST) +public interface ChangePeersAndLearnersReplicaRequest extends ReplicaRequest { + /** New peers configuration to rebalance. */ + BinaryTupleMessage pendingAssignments(); Review Comment: Why do you use BinaryTupleMessage? -- 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. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org