yuqi1129 opened a new pull request, #15034: URL: https://github.com/apache/gravitino/pull/15034
### What changes were proposed in this pull request? Implement glossary design task T3 on top of #14992: store directed BROADER edges and canonical RELATED pairs, list relations in both directions, and walk ancestors/descendants with one batched query per frontier. Add a per-metalake database hierarchy mutex with concurrent first-use initialization on H2, MySQL and PostgreSQL. The transaction entry point holds the live parent fence and mutex through outermost commit, with fresh reads after locking. Edge writes check live endpoints and use a consistent term-ID lock order. Nested failures require the outer transaction owner to propagate the error or roll back; there are no savepoints. Include table/column comments, fresh schemas and upgrade scripts, term/metalake deletion cleanup, collision-free relation tombstones and indexed, bounded garbage collection through the existing glossary GC entry point. ### Why are the changes needed? Provide relation persistence and the shared transaction mutex needed by the glossary manager. Depends on #14992, which is approved but not yet merged. This draft targets `glossary-term-dev`; its cumulative diff currently includes that dependency. The T3-only changes start after `308e6fd18d` and the branch should be rebased after #14992 merges. Fixes #14988 ### Does this PR introduce _any_ user-facing change? No REST endpoints or new configuration. Cycle/depth/RELATED-overlap checks, authorization, name/synonym checks and revision/audit updates remain manager work in T4/T5. Plain relation reads use statement snapshots; a stable multi-level walk requires an enclosing hierarchy-lock transaction. Manager reads must filter each frontier before expanding it. ### How was this patch tested? - Head `9c81db9cff`: 60 targeted tests passed with zero failures/errors/skips: H2 relation 10, definition 16 and SQL-script 14, plus entity 5 and store/cache 15 unit tests. - Targeted H2 suites cover relation directions, canonical duplicates, missing/cross-metalake endpoints, diamonds, per-frontier query counts, concurrent first use, mutex exclusion, outer commit/rollback, deletion races, tombstone reuse and bounded GC. Fresh and repeated upgrade paths are covered. - Five concurrency cases each run 20 rounds with preemptive whole-case timeouts, bounded futures/barriers, and invariant/session-closure checks after every round. - T3.4 guard: temporarily replacing frontier batching with per-term queries makes testBatchedWalkAndDiamond fail (expected 5 queries, observed 8); the batched implementation was restored. - Core Spotless and diff checks pass. No full core suite was invoked. MySQL/PostgreSQL backend execution still requires CI: Docker is unavailable locally, and the local MySQL binary cannot start because a shared library is missing. -- 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]
