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

   ### What changes were proposed in this pull request?
   
   Read a model's version rows, URI rows and alias mapping from one SQL 
statement snapshot for numeric get, alias get and list. Use the existing Java 
SQL-provider factory and base provider, returning flat rows that the service 
assembles. Pin the observed model identity and distinguish missing models from 
existing models with no matching version.
   
   Remove the three-attempt stable-model read loop. Use UNION ALL to combine 
URI and alias rows without multiplying them. Keep namespace validation, write 
OCC and the existing public service metrics. The alias selector appears in both 
UNION arms; URI and alias rows stay linear without another database round trip.
   
   ### Why are the changes needed?
   
   Concurrent version links or model alters advance the parent model's 
aggregate token. The previous split reads retried immediately and could return 
a conflict after three attempts, even for unrelated version links or comment 
changes. A single statement snapshot can return a complete committed state 
without those retries.
   
   Part of #13853: only the model-version get/list task. The epic remains open.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Model-version reads no longer fail solely because concurrent model writes 
change the aggregate token. As with a database snapshot, a successful read may 
reflect the state before a concurrent change; a model dropped, renamed or 
replaced before the snapshot is acquired is reported missing. No REST, 
configuration or schema changes.
   
   The updater's existing write-validation path is unchanged. The initial 
namespace/model lookup remains a separate statement; the following aggregate 
query validates the same model ID, name and schema ID.
   
   ### How was this patch tested?
   
   - Targeted model-version persistence suites passed on H2, MySQL 8 and 
PostgreSQL 13, including continuous links, version updates and model alters 
after every read, URI/alias completeness, empty models, and model 
deletion/rename/replacement between lookup and snapshot.
   - 236 targeted tests passed in total: model persistence suites across three 
backends, H2 model metadata tests, model dispatcher/normalize/hook tests, REST 
model operations, and 38 direct model-catalog operations. No unfiltered core 
suite was run.
   - Restoring only the old service makes all nine continuous-write regression 
cases fail with OptimisticLockException; restoring this head passes all 39 H2 
model-version cases again.
   - The Java-provider version passed H2, MySQL and PostgreSQL tests and 
Spotless. URI/alias row cardinality is tested directly, and dropping assembled 
aliases makes the completeness test fail. Fresh-context review passed with no 
outstanding findings.
   


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