This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a commit to branch ignite-27051
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 2d5bb30478815ebbb98669b77ad154623497582f
Author: Kirill Tkalenko <[email protected]>
AuthorDate: Mon Nov 17 08:22:09 2025 +0300

    IGNITE-27051 wip
---
 .../internal/table/distributed/StorageUpdateHandler.java       | 10 ++++++++--
 .../ignite/internal/table/distributed/StorageCleanupTest.java  |  9 +++++++--
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java
 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java
index 8868d7b1adc..4d642545e31 100644
--- 
a/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java
+++ 
b/modules/table/src/main/java/org/apache/ignite/internal/table/distributed/StorageUpdateHandler.java
@@ -47,6 +47,8 @@ import 
org.apache.ignite.internal.storage.TxIdMismatchException;
 import org.apache.ignite.internal.table.distributed.index.IndexUpdateHandler;
 import org.apache.ignite.internal.table.distributed.replicator.PendingRows;
 import org.apache.ignite.internal.util.Cursor;
+import org.apache.ignite.lang.ErrorGroups.Common;
+import org.apache.ignite.lang.IgniteException;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.TestOnly;
 
@@ -529,8 +531,12 @@ public class StorageUpdateHandler {
             return;
         }
 
-        assert lastCommitTs.compareTo(latestCommittedTs) >= 0 :
-                "Primary commit timestamp " + lastCommitTs + " is earlier than 
local commit timestamp " + latestCommittedTs;
+        if (lastCommitTs.compareTo(latestCommittedTs) < 0) {
+            throw new IgniteException(
+                    Common.INTERNAL_ERR,
+                    String.format("Primary commit timestamp %s is earlier than 
local commit timestamp %s", lastCommitTs, latestCommittedTs)
+            );
+        }
 
         if (lastCommitTs.compareTo(latestCommittedTs) > 0) {
             // We see that lastCommitTs is later than the timestamp of the 
committed value => we need to commit the write intent.
diff --git 
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageCleanupTest.java
 
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageCleanupTest.java
index 63c960b2651..bb1c6f6b856 100644
--- 
a/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageCleanupTest.java
+++ 
b/modules/table/src/test/java/org/apache/ignite/internal/table/distributed/StorageCleanupTest.java
@@ -63,7 +63,9 @@ import 
org.apache.ignite.internal.storage.index.impl.TestSortedIndexStorage;
 import org.apache.ignite.internal.table.TableTestUtils;
 import org.apache.ignite.internal.table.distributed.index.IndexUpdateHandler;
 import org.apache.ignite.internal.table.impl.DummyInternalTableImpl;
+import org.apache.ignite.internal.testframework.IgniteTestUtils;
 import org.apache.ignite.internal.type.NativeTypes;
+import org.apache.ignite.lang.IgniteException;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
@@ -964,8 +966,11 @@ public class StorageCleanupTest extends BaseMvStoragesTest 
{
         HybridTimestamp lastCommitTs = commitTs.subtractPhysicalTime(100);
 
         // Last commit time is before the time of the previously committed 
value => this should not happen.
-        assertThrows(AssertionError.class, () ->
-                storageUpdateHandler.handleUpdate(runningTx, rowId, 
partitionId, row3, true, null, null, lastCommitTs, null));
+        IgniteTestUtils.assertThrows(
+                IgniteException.class,
+                () -> storageUpdateHandler.handleUpdate(runningTx, rowId, 
partitionId, row3, true, null, null, lastCommitTs, null),
+                String.format("Primary commit timestamp %s is earlier than 
local commit timestamp", lastCommitTs)
+        );
 
         assertTrue(storage.read(new RowId(PARTITION_ID, rowId), 
HybridTimestamp.MAX_VALUE).isWriteIntent());
 

Reply via email to