You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "lintingbin (via GitHub)" <gi...@apache.org> on 2026/01/15 07:14:21 UTC

[PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

lintingbin opened a new pull request, #4043:
URL: https://github.com/apache/amoro/pull/4043

   
   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://amoro.apache.org/how-to-contribute/
     2. If the PR is related to an issue in https://github.com/apache/amoro/issues, add '[AMORO-XXXX]' in your PR title, e.g., '[AMORO-XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][AMORO-XXXX] Your PR title ...'.
   -->
   
   ## Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about its use case.
     2. If you fix a bug, you can clarify why it is a bug.
     3. Use Fix/Resolve/Close #{ISSUE_NUMBER} to link this PR to its related issue
   -->
   
   Close #4041.
   
   ## Brief change log
   <!--
   Clearly describe the changes made in modules, classes, methods, etc.
   -->
   
   - Initialize the TableOptimizingProcess to retrieve the Process Status from the database instead of using the default RUNNING status.
   - In the initTableRuntime, determine whether the Process Status is successful. If successful, perform the complete process operation.
   
   ## 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
   
   - [x] 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)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "lintingbin (via GitHub)" <gi...@apache.org>.
lintingbin commented on code in PR #4043:
URL: https://github.com/apache/amoro/pull/4043#discussion_r2772881370


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########


Review Comment:
   @klion26 Do you know why there is also tableRuntime.recover in the initialization function of TableOptimizingProcess? It looks a bit strange, doesn't it? Maybe we should optimize it?
   ```
         if (this.status != ProcessStatus.KILLED) {
           tableRuntime.recover(this);
         }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #4043:
URL: https://github.com/apache/amoro/pull/4043#discussion_r2772619729


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -141,6 +141,9 @@ private void initTableRuntime(DefaultTableRuntime tableRuntime) {
               mapper -> mapper.getProcessState(tableRuntime.getProcessId()));
       process = new TableOptimizingProcess(tableRuntime, meta, state);
       tableRuntime.recover(process);
+      if (process.getStatus() == ProcessStatus.SUCCESS) {

Review Comment:
   Will place this logic in `tableRuntime.recover(process)` be better?



##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -500,6 +503,7 @@ public TableOptimizingProcess(
       if (processState.getToSequence() != null) {
         toSequence = processState.getToSequence();
       }
+      this.status = processMeta.getStatus();

Review Comment:
   Just curious, why do we need this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "lintingbin (via GitHub)" <gi...@apache.org>.
lintingbin commented on code in PR #4043:
URL: https://github.com/apache/amoro/pull/4043#discussion_r2772682276


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -500,6 +503,7 @@ public TableOptimizingProcess(
       if (processState.getToSequence() != null) {
         toSequence = processState.getToSequence();
       }
+      this.status = processMeta.getStatus();

Review Comment:
   The default status is currently ProcessStatus.RUNNING. During initialization, the correct state was not properly retrieved from the database. Here, we are only restoring the state from the database.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on PR #4043:
URL: https://github.com/apache/amoro/pull/4043#issuecomment-3897607343

   Thanks for the contribution again! @lintingbin 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 commented on code in PR #4043:
URL: https://github.com/apache/amoro/pull/4043#discussion_r2780302659


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########


Review Comment:
   I don't have a strict preference for these two; these two are both ok to me, they are like different code styles to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "klion26 (via GitHub)" <gi...@apache.org>.
klion26 merged PR #4043:
URL: https://github.com/apache/amoro/pull/4043


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed the issue where the process table was completed after AMS restart, but the table status remained in the running state. [amoro]

Posted by "lintingbin (via GitHub)" <gi...@apache.org>.
lintingbin commented on code in PR #4043:
URL: https://github.com/apache/amoro/pull/4043#discussion_r2772712859


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java:
##########
@@ -141,6 +141,9 @@ private void initTableRuntime(DefaultTableRuntime tableRuntime) {
               mapper -> mapper.getProcessState(tableRuntime.getProcessId()));
       process = new TableOptimizingProcess(tableRuntime, meta, state);
       tableRuntime.recover(process);
+      if (process.getStatus() == ProcessStatus.SUCCESS) {

Review Comment:
   That makes sense, I've made the changes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org