Skip to content

[IGNITE-24413] More HA tests#5193

Merged
sanpwc merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-24413
Feb 12, 2025
Merged

[IGNITE-24413] More HA tests#5193
sanpwc merged 4 commits intoapache:mainfrom
unisonteam:IGNITE-24413

Conversation

@Cyrill
Copy link
Contributor

@Cyrill Cyrill commented Feb 7, 2025

@Cyrill Cyrill marked this pull request as ready for review February 7, 2025 12:57
int tableId = getTableId(node.catalogManager(), HA_TABLE_NAME, clock.nowLong());

for (Integer partId : PARTITION_IDS) {
assertRaftGroupsOnNodes(node, partId, tableId, HA_ZONE_NAME, 0, 1, 2, 3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, this is "Verify that the partition is rebalanced to include node D" step.
Why can't we just check that D is in stable?


executeSql(format("ALTER ZONE %s SET data_nodes_auto_adjust_scale_down=%d", HA_ZONE_NAME, 1));

waitAndAssertStableAssignmentsOfPartitionEqualTo(node, HA_TABLE_NAME, PARTITION_IDS, threeNodes);
Copy link
Contributor

@alievmirza alievmirza Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add
Verify that the data is consistent across all nodes (A, B, C, D).
as it presented in the doc, using table.internalTable().get(key, clock.now(), recipientNode)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return errors;
}

static void assertValuesPresent(Table table) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

method is unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

CompletableFuture<Void> insertFuture = keyValueView.putAsync(null, key, Tuple.create(of("val", i + offset)));

try {
insertFuture.get(10, SECONDS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use assertThat(fut, willCompleteSuccessfully()); approach here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

private static boolean isPrimaryReplicaHasChangedException(IgniteException cause) {
return cause.getMessage() != null && cause.getMessage().contains("The primary replica has changed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if sb change message? Can't we check instanceof, or error code, for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

});
}

void assertValuesPresentOnNodes(IgniteImpl node, Table table, Integer... indexes) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's pass ts here instead of node.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sanpwc sanpwc merged commit ffb8449 into apache:main Feb 12, 2025
1 check passed
@Cyrill Cyrill deleted the IGNITE-24413 branch February 12, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants