tkalkirill commented on code in PR #1305:
URL: https://github.com/apache/ignite-3/pull/1305#discussion_r1012760166
##########
modules/storage-api/src/testFixtures/java/org/apache/ignite/internal/storage/AbstractMvTableStorageTest.java:
##########
@@ -311,51 +313,89 @@ public void testMisconfiguredIndices() {
@Test
public void testStartRebalanceMvPartition() throws Exception {
+ assertThrows(StorageException.class, () ->
tableStorage.startRebalanceMvPartition(PARTITION_ID_1));
+
+ UUID hashIndexId = hashIdx.id();
+ UUID sortedIndexId = sortedIdx.id();
+
MvPartitionStorage partitionStorage =
tableStorage.getOrCreateMvPartition(PARTITION_ID);
+ HashIndexStorage hashIndexStorage =
tableStorage.getOrCreateHashIndex(PARTITION_ID, hashIndexId);
+ SortedIndexStorage sortedIndexStorage =
tableStorage.getOrCreateSortedIndex(PARTITION_ID, sortedIndexId);
+
+ RowId rowId = new RowId(PARTITION_ID);
+
+ TestKey key = new TestKey(0, "0");
+
+ BinaryRow binaryRow = binaryRow(key, new TestValue(1, "1"));
+ IndexRowImpl indexRow = new
IndexRowImpl(keyValueBinaryTuple(binaryRow), rowId);
partitionStorage.runConsistently(() -> {
- partitionStorage.addWriteCommitted(
- new RowId(PARTITION_ID),
- binaryRow(new TestKey(0, "0"), new TestValue(1, "1")),
- clock.now()
- );
+ partitionStorage.addWriteCommitted(rowId, binaryRow, clock.now());
partitionStorage.lastAppliedIndex(100);
return null;
});
+ hashIndexStorage.put(indexRow);
+
+ sortedIndexStorage.put(indexRow);
+
partitionStorage.flush().get(1, TimeUnit.SECONDS);
tableStorage.startRebalanceMvPartition(PARTITION_ID).get(1,
TimeUnit.SECONDS);
MvPartitionStorage newPartitionStorage0 =
tableStorage.getMvPartition(PARTITION_ID);
+ HashIndexStorage newHashIndexStorage0 =
tableStorage.getOrCreateHashIndex(PARTITION_ID, hashIndexId);
+ SortedIndexStorage newSortedIndexStorage0 =
tableStorage.getOrCreateSortedIndex(PARTITION_ID, sortedIndexId);
assertNotNull(newPartitionStorage0);
+ assertNotNull(newHashIndexStorage0);
+ assertNotNull(newSortedIndexStorage0);
+
assertNotSame(partitionStorage, newPartitionStorage0);
+ assertNotSame(hashIndexStorage, newHashIndexStorage0);
Review Comment:
Here we check that all storages are new and empty.
Why is this wrong?
--
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]