leaves12138 commented on code in PR #8920:
URL: https://github.com/apache/paimon/pull/8920#discussion_r3680383038


##########
paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogServer.java:
##########
@@ -2777,6 +2779,12 @@ private MockResponse commitSnapshot(
         if (!tableId.equals(table.catalogEnvironment().uuid())) {
             throw new Catalog.TableNotExistException(identifier);
         }
+        TableSnapshot currentSnapshot = 
tableLatestSnapshotStore.get(identifier.getFullName());
+        String currentSnapshotUuid =
+                currentSnapshot == null ? null : 
currentSnapshot.snapshot().uuid();
+        if (!Objects.equals(currentSnapshotUuid, baseSnapshotUuid)) {

Review Comment:
   `baseSnapshotUuid` is optional on the wire, but this strict comparison makes 
a new REST server reject every legacy client once the current snapshot has a 
UUID. I reproduced this by submitting a valid next-snapshot commit with the 
field omitted: the server returns `success=false`. Please apply UUID validation 
only when the request supplies a non-null UUID, retaining the existing 
snapshot-ID/CAS validation as the compatibility fallback, and add a 
mixed-version regression test.



##########
paimon-core/src/main/java/org/apache/paimon/catalog/Catalog.java:
##########
@@ -739,6 +740,7 @@ default boolean supportsListTableByType() {
     boolean commitSnapshot(
             Identifier identifier,
             @Nullable String tableUuid,
+            @Nullable String baseSnapshotUuid,

Review Comment:
   This replaces stable public Java APIs instead of extending them. Existing 
external `Catalog` implementations no longer implement the required method, 
while callers of `Catalog.commitSnapshot`, `RESTApi.commitSnapshot`, 
`CommitTableRequest`, and the removed `Snapshot` constructors no longer 
compile. Please retain the old signatures/constructors (deprecated if desired) 
and add overloads; in particular, the new `Catalog` overload should be a 
default bridge so existing implementations remain compatible.



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