yuqi1129 opened a new pull request, #13184:
URL: https://github.com/apache/gravitino/pull/13184

   ### What changes were proposed in this pull request?
   
   - Use strict fileset inserts and map duplicates to 
`FilesetAlreadyExistsException`. Only the insert winner creates directories; 
filesystem errors roll back the metadata insert.
   - Introduce `CREATE`, `CREATE_IF_ABSENT`, `IMPORT`, and `RECONCILE`; migrate 
production callers and retain the deprecated boolean overload for compatibility.
   - Require an observed ID/version for reconciliation, captured before the 
external read. Preserve existing identity and contents during import.
   
   ### Why are the changes needed?
   
   Concurrent fileset creates can both pass the existence check and then 
overwrite each other's metadata. Explicit intents prevent create/import paths 
from silently replacing an existing entity and prevent stale reconciliation 
from overwriting newer metadata.
   
   Fix: #13175
   
   ### Does this PR introduce _any_ user-facing change?
   
   Concurrent duplicate fileset creation fails with an already-exists error. 
Imports reject conflicting identities instead of rebinding them. Filesystem 
side effects remain nontransactional: partial failures can leave directories 
for a retry to reuse.
   
   ### How was this patch tested?
   
   639 targeted test invocations passed: core (425, including 30 write-intent 
cases across H2, MySQL, and PostgreSQL), fileset (164), Kafka (15), and model 
(35). Spotless and compilation with Error Prone/Werror passed.
   
   Concurrency tests use independent store/catalog instances and database 
connections without a shared TreeLock; they do not start two complete HTTP 
server processes. They check that exactly one fileset create succeeds, the 
winner's metadata remains intact, the loser creates no directory, and 
filesystem errors roll back metadata.
   
   Rerun the focused tests with:
   
   ```bash
   ./gradlew :core:test --tests 
'org.apache.gravitino.storage.relational.TestEntityWriteIntents' \
     :catalogs:catalog-fileset:test --tests 
'org.apache.gravitino.catalog.fileset.TestFilesetCatalogOperations' \
     -PskipITs -PskipDockerTests=false
   ```
   


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