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

   ### What changes were proposed in this pull request?
   
   `createTable`, `createTopic`, `createView` and `registerModel` now take the 
tree WRITE lock on the entity's own node (ancestors READ) instead of a 
schema-wide WRITE lock, matching `FilesetOperationDispatcher` and 
`FunctionOperationDispatcher`. Adds `TreeLockTestSupport` and four 
lock-semantics tests per dispatcher.
   
   ### Why are the changes needed?
   
   The schema WRITE lock serialized every create in a schema for the whole 
connector commit plus the entity-store transaction (see the issue for the 
load-test numbers and thread samples). Locking the entity node keeps all 
existing mutual exclusions — dropSchema/createSchema (catalog WRITE), 
rename/drop/import (schema WRITE), same-name create/load/alter (entity node) — 
and only allows `list` to run alongside an in-progress create, the trade-off 
already accepted for filesets in #8880. Same-schema create throughput measured 
locally: 34 -> 103 rps, P50 270 -> 89 ms.
   
   Fix: #13206
   
   ### Does this PR introduce _any_ user-facing change?
   
   `list*` may briefly return an entity whose creation has not committed yet; a 
subsequent load of that entity waits for the create to finish.
   
   ### How was this patch tested?
   
   New tests in `TestTable/Topic/View/ModelOperationDispatcher`: create runs 
concurrently with another in-flight create in the same schema (fails before 
this change); create waits for a same-name create, for a schema WRITE holder 
and for a catalog WRITE holder. Waiting is detected by observing the operation 
thread parked in `TreeLockNode.lock`, not by sleeping. `./gradlew :core:test 
-PskipITs` passes.
   


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