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


##########
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. These steps 
preserve the set of leaves recorded at conversion time, not container 
membership: a tagged schema or catalog drops out of the default member listing, 
its inventoried leaves become direct members, and leaves outside the inventory, 
including external tables first recorded after the switch, no longer inherit 
the domain from that container. To keep a container's future leaves, also 
assign the dedicated tag to the container when none of its leaves belongs to 
another domain through the old tag. The member list is filtered by object 
visibility, so the operator needs read and tag-assignment access to every 
affected object; an object mi
 ssing 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 7194571fe7: the container may get the dedicated tag only when every 
existing leaf that would inherit it is already in the domain's recorded 
inventory (with the `department=engineering` override example), and the note 
now states that every future leaf under it inherits the dedicated tag, 
including one later tagged `department=risk`.
   
   _🤖 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