sashapolo commented on code in PR #3584:
URL: https://github.com/apache/ignite-3/pull/3584#discussion_r1559555456


##########
modules/table/src/main/java/org/apache/ignite/internal/table/AbstractTableView.java:
##########
@@ -163,11 +164,14 @@ private <T> CompletableFuture<T> withSchemaSync(@Nullable 
Transaction tx, @Nulla
                         .handle((res, ex) -> {
                             if 
(isOrCausedBy(InternalSchemaVersionMismatchException.class, ex)) {
                                 assert tx == null : "Only for implicit 
transactions a retry might be requested";
-                                assert previousSchemaVersion == null || 
!Objects.equals(schemaVersion, previousSchemaVersion)
-                                        : "Same schema version (" + 
schemaVersion
-                                        + ") on a retry: something is wrong, 
is this caused by the test setup?";
+                                
assertSchemaVersionIncreased(previousSchemaVersion, schemaVersion);
 
                                 // Repeat.
+                                return withSchemaSync(tx, schemaVersion, 
action);
+                            } else if (tx == null && 
isOrCausedBy(IncompatibleSchemaException.class, ex)) {
+                                // Schema has changed while we were executing 
an implicit transaction: let's retry.
+                                
assertSchemaVersionIncreased(previousSchemaVersion, schemaVersion);
+
                                 return withSchemaSync(tx, schemaVersion, 
action);
                             } else {
                                 return ex == null ? completedFuture(res) : 
CompletableFuture.<T>failedFuture(ex);

Review Comment:
   I would move the null check at the very beginning, it's a bit more clear: we 
first check the normal outcome and then start checking the exceptions



##########
modules/table/src/main/java/org/apache/ignite/internal/table/AbstractTableView.java:
##########
@@ -163,11 +164,14 @@ private <T> CompletableFuture<T> withSchemaSync(@Nullable 
Transaction tx, @Nulla
                         .handle((res, ex) -> {
                             if 
(isOrCausedBy(InternalSchemaVersionMismatchException.class, ex)) {
                                 assert tx == null : "Only for implicit 
transactions a retry might be requested";
-                                assert previousSchemaVersion == null || 
!Objects.equals(schemaVersion, previousSchemaVersion)
-                                        : "Same schema version (" + 
schemaVersion
-                                        + ") on a retry: something is wrong, 
is this caused by the test setup?";
+                                
assertSchemaVersionIncreased(previousSchemaVersion, schemaVersion);
 
                                 // Repeat.
+                                return withSchemaSync(tx, schemaVersion, 
action);
+                            } else if (tx == null && 
isOrCausedBy(IncompatibleSchemaException.class, ex)) {

Review Comment:
   If this represents a schema change, then was does 
`InternalSchemaVersionMismatchException` do?



##########
modules/platforms/dotnet/Apache.Ignite.Tests/Table/SchemaSynchronizationTest.cs:
##########
@@ -339,7 +339,6 @@ public async Task TestClientUsesLatestSchemaOnReadKv()
         [Values(true, false)] bool insertNewColumn,
         [Values(true, false)] bool withRemove)
     {
-        using var metricListener = new MetricsTests.Listener();

Review Comment:
   What's this about?



-- 
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]

Reply via email to