-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BugFix] Fix null exception when insert overwrite job run concurrecy #50628
Conversation
Signed-off-by: sevev <[email protected]>
Signed-off-by: sevev <[email protected]>
fe/fe-core/src/main/java/com/starrocks/persist/InsertOverwriteStateChangeInfo.java
Show resolved
Hide resolved
fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java
Show resolved
Hide resolved
Signed-off-by: sevev <[email protected]>
fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJobRunner.java
Outdated
Show resolved
Hide resolved
Signed-off-by: sevev <[email protected]>
Quality Gate passedIssues Measures |
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 29 / 34 (85.29%) file detail
|
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
List<String> sourcePartitionNames = job.getSourcePartitionIds().stream() | ||
.map(partitionId -> targetTable.getPartition(partitionId).getName()) | ||
.collect(Collectors.toList()); | ||
List<String> sourcePartitionNames = job.getSourcePartitionNames(); |
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.
This will still lead to behavioral changes. Is there any intention in the original design? @Astralidea
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.
I'm not entirely sure, but I feel like it should be fine.
@@ -42,6 +42,9 @@ public class InsertOverwriteJob { | |||
@SerializedName(value = "warehouseId") | |||
private long warehouseId; | |||
|
|||
@SerializedName(value = "sourcePartitionNames") | |||
private List<String> sourcePartitionNames; |
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.
move to the back of sourcePartitionIds
@Mergifyio backport branch-3.3 |
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
…50628) Signed-off-by: sevev <[email protected]> (cherry picked from commit 4b057ba)
…50628) Signed-off-by: sevev <[email protected]> (cherry picked from commit 4b057ba) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJob.java
…50628) Signed-off-by: sevev <[email protected]> (cherry picked from commit 4b057ba) # Conflicts: # fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJob.java
…(backport #50628) (#50984) Co-authored-by: zhangqiang <[email protected]>
Why I'm doing:
If we run multiple insert overwrite jobs concurrency with the same partition, we will first record the partition ids and replace partition at last. However, we will create a new partition with a new partition id and replace the old partition. So only the first insert overwrite job can run success because the following jobs can not find the partition according to the partition id and they will throw null exception.
What I'm doing:
Save the source partition name and try to find the partition according to the partition name.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: