geyanggang commented on PR #13481: URL: https://github.com/apache/gravitino/pull/13481#issuecomment-5809194516
@yuqi1129 Thanks for the detailed review — it moved the design to a much better place. Summary of the rework: Off the public API. The hook is gone from TableCatalog; it's now a server-internal connector SPI, SupportsTableNameResolution (org.apache.gravitino.connector), checked via instanceof on CatalogOperations. No client-facing surface. Race fixed at the source, not documented away. Resolution moved into TableOperationDispatcher and runs inside the same tree lock each operation already takes, so resolve + catalog call + store-key write are atomic on the resolved name. load under READ, drop/purge/alter under the schema/table WRITE lock; tableExists inherits it via loadTable. Contract defined and tested. The SPI receives the normalized identifier (which already carries the caller's case intent for folding backends), resolves exact-then-unique-case-insensitive, and returns the input unchanged (never throws) when the table is absent or the name is ambiguous — so drop/exists keep boolean not-found semantics and an ambiguous name is never mis-resolved. Real implementer + end-to-end test. TestCatalogOperations implements the SPI and TestTableOperationDispatcher proves the list → load/alter/drop round-trip drives the store key with no orphan entity, plus exact-match-wins. Scope. This covers the table load/alter/drop/purge/exists paths. Authorization/owner/tag operations resolve a MetadataObject against the entity store key (they never fold and never call the connector), so they line up automatically once a table is registered under its physical name. Partitions/statistics are separate dispatcher chains, out of scope here; createTable and a rename's target name intentionally keep normal folding. Marked "Part of #13480": this is the framework SPI + wiring + an in-repo demo; a production backend opt-in follows separately. api/TableCatalog, TableNormalizeDispatcher, CatalogTestUtils and the old normalize test are reverted to main. Rebased/merged latest main; unit suites plus the real-container Postgres and MySQL table-operation tests pass. -- 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]
