-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Add RoleGrantee to provide meta-service key for RoleMgr (#1โฆ
โฆ4752) Encapsulate the logic of encoding/decoding role-grantee key into `RoleGrantee`. `RoleGrantee` is a standard `kvapi::Key` implementation so that the export program could rely on the `kvapi::Key` API to traverse meta-data to fetch all data that belongs to a tenant. Legacy issue: - For `OwnershipObject::Database{ catalog_name, db_id }`, `catalog_name` is not encoded into the key, we have to be compatible with this. The solution is to encode a `"default"` catalog with `database-by-id/<db-id>` prefix, and encode a non-default catalog with `database-by-catalog-id/<catalog>/<db-id>` prefix. The same for the `OwnershipObject::Table{ catalog_name, ... }`. - For `OwnershipObject::Table{ catalog_name, db_id, table_id }`, `db_id` is not encoded into the key. Thus `kvapi::Key::from_str_key()` can not be implemented because `db_id` is absent. - In this version, only `"default"` catalog is allowed. Using other catalog will panic. This restrict will be removed if it is confirmed there is no other catalog in our meta-data. --- - Part of #14738
- Loading branch information
1 parent
4414d6b
commit eb46c30
Showing
7 changed files
with
391 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.