You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "tkalkirill (via GitHub)" <gi...@apache.org> on 2023/04/18 05:58:24 UTC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #1938: IGNITE-19267 Implement local Low Watermark propagation

tkalkirill commented on code in PR #1938:
URL: https://github.com/apache/ignite-3/pull/1938#discussion_r1169528971


##########
modules/transactions/src/test/java/org/apache/ignite/internal/tx/TxManagerTest.java:
##########
@@ -108,4 +125,49 @@ public void testId() throws InterruptedException {
         assertTrue(txId3.compareTo(txId2) > 0);
         assertTrue(txId4.compareTo(txId3) > 0);
     }
+
+    @Test
+    void testUpdateLowerBoundToStartNewReadOnlyTransaction() {
+        when(clock.now()).thenReturn(new HybridTimestamp(10, 10));
+
+        txManager.updateLowerBoundToStartNewReadOnlyTransaction(new HybridTimestamp(10, 11));
+
+        IgniteInternalException exception = assertThrows(IgniteInternalException.class, () -> txManager.begin(true));
+
+        assertEquals(Transactions.TX_READ_ONLY_CREATING_ERR, exception.code());
+
+        // Let's check the removed lower bound.
+        txManager.updateLowerBoundToStartNewReadOnlyTransaction(null);
+
+        assertDoesNotThrow(() -> txManager.begin(true));
+    }
+
+    @Test
+    void testGetFutureReadOnlyTransactions() {
+        // Let's check the absence of transactions.
+        assertThat(txManager.getFutureAllReadOnlyTransactions(clock.now()), willSucceedFast());
+
+        InternalTransaction rwTx0 = txManager.begin(false);
+
+        InternalTransaction roTx0 = txManager.begin(true);
+        InternalTransaction roTx1 = txManager.begin(true);
+
+        CompletableFuture<Void> readOnlyTxsFutures = txManager.getFutureAllReadOnlyTransactions(roTx1.readTimestamp());

Review Comment:
   Fix it.



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org