rpuch commented on code in PR #2075:
URL: https://github.com/apache/ignite-3/pull/2075#discussion_r1197671401


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/SchemaCompatValidator.java:
##########
@@ -98,20 +98,66 @@ private ForwardValidationResult validateSchemaCompatibility(
         assert !tableSchemas.isEmpty();
 
         for (int i = 0; i < tableSchemas.size() - 1; i++) {
-            FullTableSchema from = tableSchemas.get(i);
-            FullTableSchema to = tableSchemas.get(i + 1);
-            if (!isCompatible(from, to)) {
-                return ForwardValidationResult.failure(tableId, 
from.schemaVersion(), to.schemaVersion());
+            FullTableSchema oldSchema = tableSchemas.get(i);
+            FullTableSchema newSchema = tableSchemas.get(i + 1);
+            if (!isForwardCompatible(oldSchema, newSchema)) {
+                return CompatValidationResult.failure(tableId, 
oldSchema.schemaVersion(), newSchema.schemaVersion());
             }
         }
 
-        return ForwardValidationResult.success();
+        return CompatValidationResult.success();
     }
 
-    private boolean isCompatible(FullTableSchema prevSchema, FullTableSchema 
nextSchema) {
+    private boolean isForwardCompatible(FullTableSchema prevSchema, 
FullTableSchema nextSchema) {
         TableDefinitionDiff diff = nextSchema.diffFrom(prevSchema);
 
-        // TODO: IGNITE-19229 - more sophisticated logic
+        // TODO: IGNITE-19229 - more sophisticated logic.
         return diff.isEmpty();
     }
+
+    /**
+     * Performs backward compatibility validation. That is, for a tuple that 
was just read in a transaction,
+     * checks that, if the tuple was written with a schema version later than 
the initial schema version
+     * of the transaction, the initial schema version is backward compatible 
with the tuple schema version.

Review Comment:
   I rephrased the javadoc, please take a look, is it better now?



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