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


##########
paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogServer.java:
##########
@@ -1113,7 +1245,7 @@ private MockResponse 
rollbackTableByTagNameHandle(Identifier identifier, String
     }
 
     private MockResponse rollbackSchemaHandle(Identifier identifier, String 
data) throws Exception {
-        RollbackSchemaRequest requestBody = RESTApi.fromJson(data, 
RollbackSchemaRequest.class);
+        RollbackSchemaRequest requestBody = parseRequest(data, 
RollbackSchemaRequest.class);

Review Comment:
   Schema rollback bypasses the lifecycle validation added for policies and 
column permissions. This handler calls `SchemaManager.rollbackTo` directly, 
without validating the target schema, evolving assignments, refreshing 
`tableMetadataStore`, or serializing with the table/policy lifecycle locks. For 
example: create a query-auth table, add `secret`, create a column-mask policy 
on `secret`, then roll back to the schema before `secret` existed. The rollback 
currently succeeds, leaving the stored policy (and REST metadata) inconsistent 
with the actual schema. I reproduced this with a focused `MockRESTCatalogTest`; 
the expected rejection was not raised. Please apply the same target-schema 
validation/state update as alter/replace (or reject an incompatible rollback) 
and add a regression test.



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