-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](auth)fix fe can not restart when replay create row policy log #37342
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
TPC-H: Total hot run time: 39747 ms
|
TPC-DS: Total hot run time: 172719 ms
|
ClickBench: Total hot run time: 30.67 s
|
@@ -102,6 +102,8 @@ public class RowPolicy extends Policy implements RowFilterPolicy { | |||
**/ | |||
@SerializedName(value = "originStmt") | |||
private String originStmt; | |||
@SerializedName(value = "stmtIdx") | |||
private int stmtIdx; |
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.
what will stmtIdx be when do deserialization if no stmtIdx in json
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.
will be default 0,we only support stmtIdx is 0
@@ -218,7 +225,7 @@ public boolean isInvalid() { | |||
public Expression getFilterExpression() throws AnalysisException { | |||
NereidsParser nereidsParser = new NereidsParser(); | |||
String sql = getOriginStmt(); | |||
CreatePolicyCommand command = (CreatePolicyCommand) nereidsParser.parseSingle(sql); | |||
CreatePolicyCommand command = (CreatePolicyCommand) nereidsParser.parseMultiple(sql).get(stmtIdx).first; |
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.
check out of bound error?
run buildall |
run performance |
TPC-H: Total hot run time: 39818 ms
|
TPC-DS: Total hot run time: 173737 ms
|
ClickBench: Total hot run time: 30.33 s
|
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 39524 ms
|
TPC-DS: Total hot run time: 173545 ms
|
ClickBench: Total hot run time: 31.26 s
|
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.
LGTM
…37342) When executing two SQL statements simultaneously,such as ``` DROP ROW POLICY IF EXISTS test_row_policy_3 on zd.user1;CREATE ROW POLICY test_row_policy_3 ON zd.user1 AS RESTRICTIVE TO role role1 USING (k1 in (1) or k2 in (2)); ``` fe will can not restart ``` Caused by: java.lang.ClassCastException: org.apache.doris.analysis.DropPolicyStmt cannot be cast to org.apache.doris.analysis.CreatePolicyStmt at org.apache.doris.policy.RowPolicy.gsonPostProcess(RowPolicy.java:169) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.persist.gson.GsonUtils$PostProcessTypeAdapterFactory$1.read(GsonUtils.java:640) ~[doris-fe.jar:1.2-SNAPSHOT] at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:299) ~[gson-2.10.1.jar:?] ... 14 more ``` fix: - setOrigStmt use split sql instead of full sql - store index to cope with segmentation failure
…pache#37342) When executing two SQL statements simultaneously,such as ``` DROP ROW POLICY IF EXISTS test_row_policy_3 on zd.user1;CREATE ROW POLICY test_row_policy_3 ON zd.user1 AS RESTRICTIVE TO role role1 USING (k1 in (1) or k2 in (2)); ``` fe will can not restart ``` Caused by: java.lang.ClassCastException: org.apache.doris.analysis.DropPolicyStmt cannot be cast to org.apache.doris.analysis.CreatePolicyStmt at org.apache.doris.policy.RowPolicy.gsonPostProcess(RowPolicy.java:169) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.persist.gson.GsonUtils$PostProcessTypeAdapterFactory$1.read(GsonUtils.java:640) ~[doris-fe.jar:1.2-SNAPSHOT] at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:299) ~[gson-2.10.1.jar:?] ... 14 more ``` fix: - setOrigStmt use split sql instead of full sql - store index to cope with segmentation failure
When executing two SQL statements simultaneously,such as
fe will can not restart
fix: