jerryshao commented on code in PR #15025:
URL: https://github.com/apache/gravitino/pull/15025#discussion_r4613994493


##########
design-docs/domain-design.md:
##########
@@ -58,23 +58,23 @@ DomainRel { parentId, childId, audit_info }      // one 
edge per subdomain
 - Domains live under a metalake. A subdomain and its parent are in the same 
metalake.
 - Domain names are unique within a metalake across both levels: top-level 
domains and subdomains share one namespace, so a domain is addressed by its 
name alone. Domain names follow the same constraints as tag names (up to 128 
characters) and may contain `/` (see REST API, Encoding).
 - A unique index on `DomainRel (child_id, deleted_at)` keeps one parent per 
domain. `parent` is not stored on `Domain`; the API derives it. Dropping the 
index and checks would allow multiple parents later without a data migration.
-- The backing tag is stored on the domain row as the tag's ID and an optional 
value, with an index on `(metalake_id, backing_tag_id, backing_tag_value, 
deleted_at)` for the reverse lookup "which domain does this (tag, value) back". 
`DOMAIN` is not a taggable object type, so the tag code paths are unchanged 
(see Alternatives considered).
+- The backing tag is stored on the domain row as the tag's ID, with an index 
on `(metalake_id, backing_tag_id, backing_tag_value, deleted_at)` for the 
reverse lookup "which domain does this tag back". The `backing_tag_value` 
column is kept in storage for a possible future extension, but the API never 
sets it. Domains created by 2.0.0 development builds with a value keep 
filtering membership by it; to clear the values, bind each domain to its own 
tag with `PUT /domains/{domain}/backingTag`. When several domains share one tag 
through different values (for example `department=finance` and 
`department=risk`), the existing assignments stay on the old tag, so switching 
to dedicated tags drops every member that carries only the old tag. Copying 
container assignments can widen membership: with `department=finance` on a 
schema and `department=risk` on a table beneath it, tagging the schema with 
Finance's new tag also makes the table a Finance member. To preserve the 
existing leaf memberships
 : (1) record each domain's own leaf members with `GET 
/domains/{domain}/objects?expand=true`, keeping those whose relations include 
Direct or Inherited; (2) create the dedicated tags and assign each directly to 
the recorded leaves of its domain; (3) switch the bindings to the dedicated 
tags; (4) optionally remove the old tag's assignments by name. The member list 
is filtered by object visibility, so the operator needs read and tag-assignment 
access to every affected object; an object missing from the inventory loses its 
membership when the binding changes. `DOMAIN` is not a taggable object type, so 
the tag code paths are unchanged (see Alternatives considered).

Review Comment:
   Fixed in 127ac3e884: the conversion note now states that the steps preserve 
the leaf set recorded at conversion time, that tagged containers drop out of 
the default listing while their inventoried leaves become direct members, and 
that leaves outside the inventory (including external tables recorded later) 
stop inheriting from the container; it also notes when the container itself can 
be tagged to keep future leaves.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



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