-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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](dynamic partition) fix dynamic partition thread met uncatch exception #35778
[fix](dynamic partition) fix dynamic partition thread met uncatch exception #35778
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
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
PR approved by anyone and no changes requested. |
run buildall |
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
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
TPC-H: Total hot run time: 39982 ms
|
PR approved by at least one committer and no changes requested. |
TPC-DS: Total hot run time: 172449 ms
|
ClickBench: Total hot run time: 31.17 s
|
78bedce
to
2799ded
Compare
run buildall |
…eption (#35778) dynamic partition thread get table's drop clause met an error due to dynamic_partition.start = -99999999 ``` 2024-05-23 10:40:32,072 ERROR (DynamicPartitionScheduler|53) [Daemon.run():118] daemon thread got exception. name: DynamicPartitionScheduler org.apache.doris.nereids.exceptions.AnalysisException: date/datetime literal [+271768-09-11 00:00:00] is invalid at org.apache.doris.nereids.trees.expressions.literal.DateLiteral.normalize(DateLiteral.java:202) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.trees.expressions.literal.DateTimeLiteral.determineScale(DateTimeLiteral.java:107) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.types.DateTimeV2Type.forTypeFromString(DateTimeV2Type.java:91) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.trees.expressions.literal.DateTimeV2Literal.<init>(DateTimeV2Literal.java:38) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.catalog.PartitionKey.getDateTimeLiteral(PartitionKey.java:120) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.catalog.PartitionKey.createPartitionKey(PartitionKey.java:98) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.getDropPartitionClause(DynamicPartitionScheduler.java:431) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.executeDynamicPartition(DynamicPartitionScheduler.java:555) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.runAfterCatalogReady(DynamicPartitionScheduler.java:641) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.common.util.MasterDaemon.runOneCycle(MasterDaemon.java:58) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.common.util.Daemon.run(Daemon.java:116) ~[doris-fe.jar:1.2-SNAPSHOT] ``` BUG: 1. dynamic partition thread not catch org.apache.doris.nereids.exceptions.AnalysisException; 2. getDropClauses use dynamic_partition.start as the partitions's start. But it's error, it should should max(dynamic_partition.start, -dynamic_partition.history_partition_num). FIX: 1. dynamic partition thread catch org.apache.doris.nereids.exceptions.AnalysisException; 2. getDropClauses use start = max(dynamic_partition.start, -dynamic_partition.history_partition_num); 3. When create table (i.e. create dynamic partion first time), if met an exception, then throw this exception out, then create table will fail, so user can known this error;
…eption (apache#35778) dynamic partition thread get table's drop clause met an error due to dynamic_partition.start = -99999999 ``` 2024-05-23 10:40:32,072 ERROR (DynamicPartitionScheduler|53) [Daemon.run():118] daemon thread got exception. name: DynamicPartitionScheduler org.apache.doris.nereids.exceptions.AnalysisException: date/datetime literal [+271768-09-11 00:00:00] is invalid at org.apache.doris.nereids.trees.expressions.literal.DateLiteral.normalize(DateLiteral.java:202) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.trees.expressions.literal.DateTimeLiteral.determineScale(DateTimeLiteral.java:107) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.types.DateTimeV2Type.forTypeFromString(DateTimeV2Type.java:91) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.nereids.trees.expressions.literal.DateTimeV2Literal.<init>(DateTimeV2Literal.java:38) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.catalog.PartitionKey.getDateTimeLiteral(PartitionKey.java:120) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.catalog.PartitionKey.createPartitionKey(PartitionKey.java:98) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.getDropPartitionClause(DynamicPartitionScheduler.java:431) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.executeDynamicPartition(DynamicPartitionScheduler.java:555) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.clone.DynamicPartitionScheduler.runAfterCatalogReady(DynamicPartitionScheduler.java:641) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.common.util.MasterDaemon.runOneCycle(MasterDaemon.java:58) ~[doris-fe.jar:1.2-SNAPSHOT] at org.apache.doris.common.util.Daemon.run(Daemon.java:116) ~[doris-fe.jar:1.2-SNAPSHOT] ``` BUG: 1. dynamic partition thread not catch org.apache.doris.nereids.exceptions.AnalysisException; 2. getDropClauses use dynamic_partition.start as the partitions's start. But it's error, it should should max(dynamic_partition.start, -dynamic_partition.history_partition_num). FIX: 1. dynamic partition thread catch org.apache.doris.nereids.exceptions.AnalysisException; 2. getDropClauses use start = max(dynamic_partition.start, -dynamic_partition.history_partition_num); 3. When create table (i.e. create dynamic partion first time), if met an exception, then throw this exception out, then create table will fail, so user can known this error;
…pache#37488) Fix: for creating table, if create dynamic partition throw exception (pr apache#35778), then create table will fail, then drop table, but it forget to write an editlog.
…pache#37488) Fix: for creating table, if create dynamic partition throw exception (pr apache#35778), then create table will fail, then drop table, but it forget to write an editlog.
…#37539) FIX: When dropping dynamic partition, PR #35778 will use math.max(start, -history_partition_num) as the first partition, but it may delete users' partitions if they specify both start and history_partition_num inappropriately. For safety reason, revert this behavious changed, only use start as the first partition when dropping partitions. For those who had specified a very small start value, drop partitions will catch an exception , and stop dropping this table's partition and then record this error in dynamic info. Users can use command `SHOW DYNAMIC PARTITION TABLES FROM DBXXX` to know this error. From this error, it will give user hint to modify start if they really specify a error start. --------- Co-authored-by: Yongqiang YANG <[email protected]>
…#37539) FIX: When dropping dynamic partition, PR #35778 will use math.max(start, -history_partition_num) as the first partition, but it may delete users' partitions if they specify both start and history_partition_num inappropriately. For safety reason, revert this behavious changed, only use start as the first partition when dropping partitions. For those who had specified a very small start value, drop partitions will catch an exception , and stop dropping this table's partition and then record this error in dynamic info. Users can use command `SHOW DYNAMIC PARTITION TABLES FROM DBXXX` to know this error. From this error, it will give user hint to modify start if they really specify a error start. --------- Co-authored-by: Yongqiang YANG <[email protected]>
…apache#37539) FIX: When dropping dynamic partition, PR apache#35778 will use math.max(start, -history_partition_num) as the first partition, but it may delete users' partitions if they specify both start and history_partition_num inappropriately. For safety reason, revert this behavious changed, only use start as the first partition when dropping partitions. For those who had specified a very small start value, drop partitions will catch an exception , and stop dropping this table's partition and then record this error in dynamic info. Users can use command `SHOW DYNAMIC PARTITION TABLES FROM DBXXX` to know this error. From this error, it will give user hint to modify start if they really specify a error start. --------- Co-authored-by: Yongqiang YANG <[email protected]>
…apache#37539) FIX: When dropping dynamic partition, PR apache#35778 will use math.max(start, -history_partition_num) as the first partition, but it may delete users' partitions if they specify both start and history_partition_num inappropriately. For safety reason, revert this behavious changed, only use start as the first partition when dropping partitions. For those who had specified a very small start value, drop partitions will catch an exception , and stop dropping this table's partition and then record this error in dynamic info. Users can use command `SHOW DYNAMIC PARTITION TABLES FROM DBXXX` to know this error. From this error, it will give user hint to modify start if they really specify a error start. --------- Co-authored-by: Yongqiang YANG <[email protected]>
…t throw exception (#37924) PR #35778 will throw exception if dynamic partition overlap with others. Don't throw exception due to considering no behaviour change. Just ignore create this partition. SQL: ``` PARTITION BY RANGE(`dt`)( PARTITION `phistory` VALUES less than ('2024-01-01') ) DISTRIBUTED BY HASH(`user_id`, `room_id`) BUCKETS 3 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "dynamic_partition.enable" = "true", "dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "10", "dynamic_partition.prefix" = "p", "dynamic_partition.create_history_partition" = "true", "dynamic_partition.history_partition_num" = "250" ); ``` error: ``` ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = errCode = 2, detailMessage = Range [types: [DATEV2]; keys: [0000-01-01]; ..types: [DATEV2]; keys: [2024-01-01]; ) is intersected with range: [types: [DATEV2]; keys: [2023-12-29]; ..types: [DATEV2]; keys: [2023-12-30]; ) ```
…t throw exception (#37924) PR #35778 will throw exception if dynamic partition overlap with others. Don't throw exception due to considering no behaviour change. Just ignore create this partition. SQL: ``` PARTITION BY RANGE(`dt`)( PARTITION `phistory` VALUES less than ('2024-01-01') ) DISTRIBUTED BY HASH(`user_id`, `room_id`) BUCKETS 3 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "dynamic_partition.enable" = "true", "dynamic_partition.time_unit" = "DAY", "dynamic_partition.end" = "10", "dynamic_partition.prefix" = "p", "dynamic_partition.create_history_partition" = "true", "dynamic_partition.history_partition_num" = "250" ); ``` error: ``` ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = errCode = 2, detailMessage = Range [types: [DATEV2]; keys: [0000-01-01]; ..types: [DATEV2]; keys: [2024-01-01]; ) is intersected with range: [types: [DATEV2]; keys: [2023-12-29]; ..types: [DATEV2]; keys: [2023-12-30]; ) ```
…eption apache#35778 (apache#35824) cherry pick from apache#35778
dynamic partition thread get table's drop clause met an error due to dynamic_partition.start = -99999999
BUG:
FIX:
Proposed changes
Issue Number: close #xxx