tkalkirill commented on code in PR #1462:
URL: https://github.com/apache/ignite-3/pull/1462#discussion_r1055192919
##########
modules/transactions/src/testFixtures/java/org/apache/ignite/internal/tx/storage/state/AbstractTxStateStorageTest.java:
##########
@@ -257,53 +247,178 @@ public void
scanOnlySeesDataExistingAtTheMomentOfCreation() throws Exception {
List<UUID> txIdsReturnedByScan = cursor.stream()
.map(IgniteBiTuple::getKey)
.collect(toList());
+
assertThat(txIdsReturnedByScan, is(List.of(existingBeforeScan)));
}
-
- partitionStorage.close();
}
@Test
void lastAppliedIndexGetterIsConsistentWithSetter() {
TxStateStorage partitionStorage =
tableStorage.getOrCreateTxStateStorage(0);
- try {
- partitionStorage.lastApplied(10, 2);
+ partitionStorage.lastApplied(10, 2);
- assertThat(partitionStorage.lastAppliedIndex(), is(10L));
- } finally {
- partitionStorage.close();
- }
+ assertThat(partitionStorage.lastAppliedIndex(), is(10L));
}
@Test
void lastAppliedTermGetterIsConsistentWithSetter() {
TxStateStorage partitionStorage =
tableStorage.getOrCreateTxStateStorage(0);
- try {
- partitionStorage.lastApplied(10, 2);
+ partitionStorage.lastApplied(10, 2);
- assertThat(partitionStorage.lastAppliedTerm(), is(2L));
- } finally {
- partitionStorage.close();
- }
+ assertThat(partitionStorage.lastAppliedTerm(), is(2L));
}
@Test
void compareAndSetMakesLastAppliedChangeVisible() {
TxStateStorage partitionStorage =
tableStorage.getOrCreateTxStateStorage(0);
- try {
- UUID txId = UUID.randomUUID();
- partitionStorage.compareAndSet(txId, null, randomTxMeta(1, txId),
10, 2);
+ UUID txId = UUID.randomUUID();
+ partitionStorage.compareAndSet(txId, null, randomTxMeta(1, txId), 10,
2);
+
+ assertThat(partitionStorage.lastAppliedIndex(), is(10L));
+ assertThat(partitionStorage.lastAppliedTerm(), is(2L));
+ }
+
+ @Test
+ public void testSuccessFullRebalance() throws Exception {
+ TxStateStorage storage = tableStorage.getOrCreateTxStateStorage(0);
+
+ // Nothing will happen because the full rebalance has not started.
+ storage.finishFullRebalance(100, 500).get(1, SECONDS);
Review Comment:
You're right, it makes sense.
--
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]