-
Notifications
You must be signed in to change notification settings - Fork 836
refactor(query): prevent masking/row access policy name conflicts #18937
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
base: main
Are you sure you want to change the base?
Conversation
drmingdrmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drmingdrmer reviewed 2 of 4 files at r1, all commit messages.
Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions
src/meta/api/src/data_mask_api_impl.rs line 105 at r1 (raw file):
) .into()); }
This function looks strange:
- fetch_id can be moved out from the transaction-retry-loop
- it does not need a loop to retry: just one transaction trial would be enough.
Code quote:
let row_access_name_ident = RowAccessPolicyNameIdent::new(
name_ident.tenant().clone(),
name_ident.data_mask_name().to_string(),
);
if self.get_pb(&row_access_name_ident).await?.is_some() {
return Err(AppError::DatamaskAlreadyExists(
name_ident.exist_error("name conflicts with an existing row access policy"),
)
.into());
}src/meta/api/src/data_mask_api_impl.rs line 112 at r1 (raw file):
// data mask name -> data mask table id list let id = fetch_id(self, IdGenerator::data_mask_id()).await?;
fetch_id can be moved out from the transaction-retry-loop.
TCeason
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @drmingdrmer)
src/meta/api/src/data_mask_api_impl.rs line 105 at r1 (raw file):
Previously, drmingdrmer (张炎泼) wrote…
This function looks strange:
- fetch_id can be moved out from the transaction-retry-loop
- it does not need a loop to retry: just one transaction trial would be enough.
Done.
src/meta/api/src/data_mask_api_impl.rs line 112 at r1 (raw file):
Previously, drmingdrmer (张炎泼) wrote…
fetch_id can be moved out from the transaction-retry-loop.
Done.
83a09cf to
13f59cd
Compare
870e534 to
c4f2c39
Compare
🤖 CI Job Analysis
⛔️ CANCELLEDHigher priority request detected - retry cancelled to avoid conflicts. |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
prevent masking/row access policy name conflicts
Tests
Type of change
This change is