Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue: tenant migration #14719

Open
29 tasks done
drmingdrmer opened this issue Feb 23, 2024 · 0 comments
Open
29 tasks done

Tracking issue: tenant migration #14719

drmingdrmer opened this issue Feb 23, 2024 · 0 comments

Comments

@drmingdrmer
Copy link
Member

drmingdrmer commented Feb 23, 2024

Feature request:

  • Export all meta-data belonging to a tenant;
  • Import meta-data belonging to a tenant;

Not do

  • share and all related meta data is not exported or imported. Because share can not be maintained cross two meta-service cluster.

Current tenant meta-data must be prefixed so that no two records have same key.

Step-1 standardize keys with kvapi::Key

All to meta-service request should use kvapi::Key so that the relationship between records are well defined.

Step-2: remove unnecessary serde::Serialize declaration

Because we need to keep compatibility when updating the kvapi::Key implementations(e.g., add Tenant info to a key), we need to ensure no other encoding methods are used.

Step-3: force all tenant used in kvapi::Key non-empty: replace field tenant: String with tenant: Tenant

Step-4 Filter out keys belonging to a tenant, directly or indirectly

drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 21, 2024
`BackgroundJobIdent` is a kvapi::Key but not a value.
It does not need to be `serde`.
Thus in this commit we create another struct `BackgroundTaskCreator`
with the same structure as `BackgroundJobIdent` for usage in values.

And remove `serde` declaration from `BackgroundJobIdent`.

- Part of databendlabs#14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 22, 2024
`BackgroundJobIdent` is a kvapi::Key but not a value.
It does not need to be `serde`.
Thus in this commit we create another struct `BackgroundTaskCreator`
with the same structure as `BackgroundJobIdent` for usage in values.

And remove `serde` declaration from `BackgroundJobIdent`.

- Part of databendlabs#14719
drmingdrmer added a commit that referenced this issue Mar 22, 2024
refactor: add `BackgroundTaskCreator`

`BackgroundJobIdent` is a kvapi::Key but not a value.
It does not need to be `serde`.
Thus in this commit we create another struct `BackgroundTaskCreator`
with the same structure as `BackgroundJobIdent` for usage in values.

And remove `serde` declaration from `BackgroundJobIdent`.

- Part of #14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 23, 2024
Define BackgroundJobIdent with `TIdent`, make
`BackgroundJobIdent.tenant` a `Tenant` instead of a plain `String`.

- Part of databendlabs#14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 23, 2024
Define BackgroundJobIdent with `TIdent`, make
`BackgroundJobIdent.tenant` a `Tenant` instead of a plain `String`.

- Part of databendlabs#14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 23, 2024
Define BackgroundJobIdent with `TIdent`, make
`BackgroundJobIdent.tenant` a `Tenant` instead of a plain `String`.

- Part of databendlabs#14719
drmingdrmer added a commit that referenced this issue Mar 23, 2024
Define BackgroundJobIdent with `TIdent`, make
`BackgroundJobIdent.tenant` a `Tenant` instead of a plain `String`.

- Part of #14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 23, 2024
Remove `impl FromToProto for BackgroundTaskIdent`, it does not need to
be encoded to protobuf.

- Part of databendlabs#14719
BohuTANG pushed a commit that referenced this issue Mar 23, 2024
Remove `impl FromToProto for BackgroundTaskIdent`, it does not need to
be encoded to protobuf.

- Part of #14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 26, 2024
There is no need to have the entire `Settings` in `QueryFragmentsPlanPacket`.
Only the `Settings.changes` is used.

And `Settings.tenant` can not be `serde` in future, ths
`QueryFragmentsPlanPacket` can not include a `Tenant` in it.

- Part of databendlabs#14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 26, 2024
There is no need to have the entire `Settings` in `QueryFragmentsPlanPacket`.
Only the `Settings.changes` is used.

And `Settings.tenant` can not be `serde` in future, ths
`QueryFragmentsPlanPacket` can not include a `Tenant` in it.

- Part of databendlabs#14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 26, 2024
There is no need to have the entire `Settings` in `QueryFragmentsPlanPacket`.
Only the `Settings.changes` is used.

And `Settings.tenant` can not be `serde` in future, ths
`QueryFragmentsPlanPacket` can not include a `Tenant` in it.

- Part of databendlabs#14719
BohuTANG pushed a commit that referenced this issue Mar 27, 2024
…ges (#15095)

There is no need to have the entire `Settings` in `QueryFragmentsPlanPacket`.
Only the `Settings.changes` is used.

And `Settings.tenant` can not be `serde` in future, ths
`QueryFragmentsPlanPacket` can not include a `Tenant` in it.

- Part of #14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 27, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 28, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 28, 2024
drmingdrmer added a commit that referenced this issue Mar 28, 2024
* refactor: replace `NonEmptyString` with `Tenant`

- Part of #14719
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 28, 2024
Replacing all String with Tenant introduces a lot changes.
These changes will be split into several PRs.
This is one of them.

- Part of databendlabs#14719
drmingdrmer added a commit that referenced this issue Mar 29, 2024
* refactor: replace String with Tenant

Replacing all String with Tenant introduces a lot changes.
These changes will be split into several PRs.
This is one of them.

- Part of #14719

* chore: fix lint

* chore: fix lint

* chore: fix lint

* chore: fix unittest

* chore: fix lint
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 29, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 29, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 29, 2024
drmingdrmer added a commit to drmingdrmer/databend that referenced this issue Mar 29, 2024
BohuTANG pushed a commit that referenced this issue Mar 30, 2024
…Ident and DataMaskNameIdent (#15123)

* refactor: use map_res() to emit an sql error

* refactor: use TIdent to unify kvapi key def for MaskPolicyTableIdListIdent and DataMaskNameIdent

- Part of #14719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant