adityamukho commented on code in PR #7644:
URL: https://github.com/apache/ignite-3/pull/7644#discussion_r2845971568
##########
modules/index/src/integrationTest/java/org/apache/ignite/internal/index/ItBuildIndexTest.java:
##########
@@ -116,6 +119,46 @@ void testBuildIndexOnStableTopology(int replicas) throws
Exception {
.check();
}
+ @Test
+ void testRaftCommandsDuplicationOnPrimaryNotCollocatedWithLeader() throws
Exception {
+ int replicas = 2;
+ int partitions = 1;
+
+ LogInspector logInspector = new LogInspector(
+ BuildIndexCommandHandler.class.getName(),
+ evt ->
evt.getMessage().getFormattedMessage().contains("Duplicated building the index
command received")
+ );
+
+ logInspector.start();
+ try {
+ createAndPopulateTable(replicas, partitions);
+
+ ZonePartitionId tableGroupId = replicationGroupId(TABLE_NAME, 0);
+
+ IgniteImpl currentPrimary = primaryReplica(tableGroupId);
+
+ changeLeader(tableGroupId, currentPrimary);
+
+ createIndex(INDEX_NAME);
+
+ checkIndexBuild(partitions, replicas, INDEX_NAME);
+
+ assertFalse(logInspector.isMatched());
+ } finally {
+ logInspector.stop();
+ }
+ }
+
+ private static void changeLeader(ZonePartitionId groupId, IgniteImpl
currentPrimary) throws Exception {
Review Comment:
Maybe this method can be moved to the end of file to keep all test methods
together?
##########
modules/index/src/test/java/org/apache/ignite/internal/index/IndexBuilderTest.java:
##########
@@ -235,13 +239,25 @@ void testScheduleBuildIndexAfterDisasterRecovery() {
assertThat(listenCompletionIndexBuildingAfterDisasterRecoveryFuture,
willCompleteSuccessfully());
}
- private void scheduleBuildIndex(int indexId, int zoneId, int tableId, int
partitionId, Collection<RowId> nextRowIdsToBuild) {
+ private void scheduleBuildIndex(int indexId, int zoneId, int tableId, int
partitionId, Collection<RowId> rowIds) {
+ BinaryRowImpl binaryRow = new BinaryRowImpl(1, ByteBuffer.allocate(1));
Review Comment:
Can we make this a `BinaryRow`, please.
##########
modules/index/src/test/java/org/apache/ignite/internal/index/IndexBuilderTest.java:
##########
@@ -328,11 +344,9 @@ private CompletableFuture<Void>
awaitSecondInvokeForReplicaService(CompletableFu
}
private static IndexStorage indexStorage(Collection<RowId>
nextRowIdsToBuild) {
Review Comment:
Can we remove the unused parameter?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]