Victory-ET opened a new pull request, #10613:
URL: https://github.com/apache/gravitino/pull/10613

   1. Title: [#10602] fix(core): Check update count in 
FilesetMetaService.updateFileset
   
   ### What changes were proposed in this pull request?
   
   This PR fixes a bug in `FilesetMetaService.updateFileset` where a 
potentially unsafe success path occurs when `checkNeedUpdateVersion` evaluates 
to true. We now explicitly capture the row count result from 
`updateFilesetMeta(...)` by changing the underlying session utility logic to 
`getWithoutCommit` instead of a void execution. If the updated row count is 0, 
we properly treat it as an update conflict and fail the operation.
   
   ### Why are the changes needed?
   
   Because `updateFilesetMeta(...)` relies on optimistic matching on old row 
values, it could previously return 0 if the metadata row changed between reads 
and updates. However, it would force an unconditional success without checking 
this row count. This could lead to data inconsistencies and masked write 
failures where operations reported success despite the fileset metadata update 
not being applied.
   
   Fix: #(10602)
   
   ### Does this PR introduce _any_ user-facing change?
   
   No user-facing APIs were altered.
   
   ### How was this patch tested?
   
   A new unit test 
`testUpdateFilesetReturnsSuccessWhenVersionedMetaUpdateAffectsNoRows` was added 
to `TestFilesetMetaService.java` to simulate locking conflict anomalies and 
assert that a proper runtime IO error exception is thrown instead of masking it 
as a silent success.
   


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