Skip to content

[AMORO-3110] Avoid optimization status blocking in running#3113

Merged
zhoujinsong merged 3 commits intoapache:masterfrom
rfyu:amoro-3110
Sep 14, 2024
Merged

[AMORO-3110] Avoid optimization status blocking in running#3113
zhoujinsong merged 3 commits intoapache:masterfrom
rfyu:amoro-3110

Conversation

@rfyu
Copy link
Contributor

@rfyu rfyu commented Aug 19, 2024

Why are the changes needed?

Close #3110.

Brief change log

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before making a pull request

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@github-actions github-actions bot added the module:ams-server Ams server module label Aug 19, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.18%. Comparing base (9def89f) to head (eb71869).
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3113      +/-   ##
============================================
- Coverage     27.64%   27.18%   -0.46%     
+ Complexity     2496     2462      -34     
============================================
  Files           360      363       +3     
  Lines         37133    37471     +338     
  Branches       5372     5400      +28     
============================================
- Hits          10265    10187      -78     
- Misses        25908    26327     +419     
+ Partials        960      957       -3     
Flag Coverage Δ
trino 27.18% <ø> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rfyu Thanks for trying to solve this issue.

I left some comments, PTAL.

}
} catch (Exception e) {
LOG.error("accept result error:", e);
throw e;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should throw the exception rather than just printing logs.
But we may just remove the catch blocks because we will print error logs in the service proxy.


public void addTaskQuota(TaskRuntime.TaskQuota taskQuota) {
doAs(OptimizingMapper.class, mapper -> mapper.insertTaskQuota(taskQuota));
doAsAlone(OptimizingMapper.class, mapper -> mapper.insertTaskQuota(taskQuota));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we started another transaction to update the quota.
Another method to solve this issue is using the same transaction and ignoring the persistent error. We can add a method like doAsIgnoreError in PersistentBase to get that.

What do you think is the better method? @rfyu

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your suggestion. It is acceptable to handle it using the same transaction. I will make the necessary modifications accordingly.

@zhoujinsong
Copy link
Contributor

LGTM.

However, there are some conflicts that should be fixed. @rfyu

Copy link
Contributor

@zhoujinsong zhoujinsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@zhoujinsong zhoujinsong merged commit 9877c20 into apache:master Sep 14, 2024
zhoujinsong pushed a commit that referenced this pull request Oct 11, 2024
* [AMORO-3110] Avoid optimization status blocking in running

* format

* Ignore the exception when it occurs and do not perform a rollback

(cherry picked from commit 9877c20)
Signed-off-by: zhoujinsong <zhoujinsong0505@163.com>
xxubai pushed a commit to xxubai/amoro that referenced this pull request Dec 10, 2024
* [AMORO-3110] Avoid optimization status blocking in running

* format

* Ignore the exception when it occurs and do not perform a rollback

(cherry picked from commit 9877c20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-server Ams server module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Optimization state blocking in running

3 participants