Skip to content

Modify the optimizer to support obtaining tasks from each AMS node for processing.#3950

Open
wardlican wants to merge 26 commits intoapache:masterfrom
wardlican:amoro#3928
Open

Modify the optimizer to support obtaining tasks from each AMS node for processing.#3950
wardlican wants to merge 26 commits intoapache:masterfrom
wardlican:amoro#3928

Conversation

@wardlican
Copy link
Contributor

@wardlican wardlican commented Nov 17, 2025

Why are the changes needed?

In master-slave mode, the optimizer needs to support pulling optimization tasks from each ams node for processing.

Close #3928.

Brief change log

  1. In master-slave mode, the optimizer can pull tasks from each currently active AMS.
  2. In master-slave mode, the AMS automatically detects the addition and timeout of the optimizer from the database.

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? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

wardli added 18 commits October 29, 2025 17:49
@github-actions github-actions bot added module:ams-server Ams server module module:ams-optimizer AMS optimizer module module:common labels Nov 17, 2025
@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 20, 2025
@wardlican
Copy link
Contributor Author

Please help with the code review.

@github-actions github-actions bot removed the stale label Dec 23, 2025
@czy006
Copy link
Contributor

czy006 commented Dec 26, 2025

After resolving any conflicts in the code, I will initiate the first review on my end cc @wardlican

1 similar comment
@czy006
Copy link
Contributor

czy006 commented Dec 26, 2025

After resolving any conflicts in the code, I will initiate the first review on my end cc @wardlican

# Conflicts:
#	amoro-ams/src/main/java/org/apache/amoro/server/ha/ZkHighAvailabilityContainer.java
#	amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java
#	amoro-ams/src/main/resources/mysql/upgrade.sql
#	amoro-ams/src/main/resources/postgres/upgrade.sql
#	amoro-ams/src/test/java/org/apache/amoro/server/AMSServiceTestBase.java
…troduces a new solution for storing allocation information based on a database.
@wardlican
Copy link
Contributor Author

wardlican commented Dec 29, 2025

After resolving any conflicts in the code, I will initiate the first review on my end cc @wardlican

Okay, I will resolve the conflicts based on the latest master branch and add support for a database-based storage solution for bucket allocation information, based on the latest HA (High Availability) scheme. @czy006

wardli and others added 3 commits December 29, 2025 15:46
@github-actions github-actions bot added the type:docs Improvements or additions to documentation label Dec 29, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2025

Codecov Report

❌ Patch coverage is 31.85247% with 813 lines in your changes missing coverage. Please review.
✅ Project coverage is 30.15%. Comparing base (cbdc517) to head (b6be852).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
...apache/amoro/server/table/DefaultTableService.java 9.17% 179 Missing and 9 partials ⚠️
...ache/amoro/optimizer/common/OptimizerExecutor.java 2.04% 94 Missing and 2 partials ⚠️
...apache/amoro/server/DatabaseBucketAssignStore.java 0.00% 80 Missing ⚠️
.../apache/amoro/server/DefaultOptimizingService.java 19.78% 71 Missing and 2 partials ⚠️
...ain/java/org/apache/amoro/client/AmsThriftUrl.java 0.00% 60 Missing ⚠️
...java/org/apache/amoro/server/AmsAssignService.java 75.84% 40 Missing and 17 partials ⚠️
.../apache/amoro/optimizer/common/AmsNodeManager.java 0.00% 47 Missing ⚠️
...o/server/ha/DataBaseHighAvailabilityContainer.java 0.00% 45 Missing ⚠️
...a/org/apache/amoro/server/ZkBucketAssignStore.java 66.66% 34 Missing and 5 partials ⚠️
...org/apache/amoro/server/AmoroServiceContainer.java 7.89% 33 Missing and 2 partials ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3950      +/-   ##
============================================
+ Coverage     22.12%   30.15%   +8.02%     
- Complexity     2461     4165    +1704     
============================================
  Files           445      658     +213     
  Lines         40897    53207   +12310     
  Branches       5767     6808    +1041     
============================================
+ Hits           9050    16043    +6993     
- Misses        31089    35957    +4868     
- Partials        758     1207     +449     
Flag Coverage Δ
core 30.15% <31.85%> (?)
trino ?

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 29, 2026
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Feb 5, 2026
@czy006 czy006 reopened this Feb 26, 2026
@github-actions github-actions bot removed the stale label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:ams-optimizer AMS optimizer module module:ams-server Ams server module module:common type:docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask]: Modify the optimizer to support obtaining tasks from each AMS node for processing.

3 participants