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

[BugFix] Fix null exception when insert overwrite job run concurrecy #50628

Merged
merged 4 commits into from
Sep 12, 2024

Conversation

sevev
Copy link
Contributor

@sevev sevev commented Sep 3, 2024

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:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

Signed-off-by: sevev <[email protected]>
@gengjun-git gengjun-git self-assigned this Sep 4, 2024
Signed-off-by: sevev <[email protected]>
Copy link

sonarcloud bot commented Sep 5, 2024

Copy link

github-actions bot commented Sep 5, 2024

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Sep 5, 2024

[FE Incremental Coverage Report]

pass : 29 / 34 (85.29%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/load/InsertOverwriteJobRunner.java 22 27 81.48% [236, 456, 458, 560, 561]
🔵 com/starrocks/load/InsertOverwriteJob.java 3 3 100.00% []
🔵 com/starrocks/persist/InsertOverwriteStateChangeInfo.java 4 4 100.00% []

Copy link

github-actions bot commented Sep 5, 2024

[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();
Copy link
Contributor

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

Copy link
Contributor

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.

@meegoo meegoo enabled auto-merge (squash) September 11, 2024 03:26
@@ -42,6 +42,9 @@ public class InsertOverwriteJob {
@SerializedName(value = "warehouseId")
private long warehouseId;

@SerializedName(value = "sourcePartitionNames")
private List<String> sourcePartitionNames;
Copy link
Contributor

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

@meegoo meegoo merged commit 4b057ba into StarRocks:main Sep 12, 2024
57 checks passed
Copy link

@Mergifyio backport branch-3.3

Copy link

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.3 label Sep 12, 2024
Copy link

@Mergifyio backport branch-3.1

Copy link
Contributor

mergify bot commented Sep 12, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented Sep 12, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Sep 12, 2024

backport branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 12, 2024
mergify bot pushed a commit that referenced this pull request Sep 12, 2024
…50628)

Signed-off-by: sevev <[email protected]>
(cherry picked from commit 4b057ba)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJob.java
mergify bot pushed a commit that referenced this pull request Sep 12, 2024
…50628)

Signed-off-by: sevev <[email protected]>
(cherry picked from commit 4b057ba)

# Conflicts:
#	fe/fe-core/src/main/java/com/starrocks/load/InsertOverwriteJob.java
wanpengfei-git pushed a commit that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants