xxubai opened a new issue, #4103: URL: https://github.com/apache/amoro/issues/4103
### What happened? When tables are in PLANNING or PENDING optimizing status and their associated resource group is not exist , these tables will be stuck in PLANNING/PENDING status forever. They can never be scheduled for optimizing or return to IDLE status. This happens in the following scenario: > Config change + AMS restart race condition: A table's self-optimizing config is changed (e.g., optimizer group changed from "old_group" to "default"), but AMS restarts before the optimizing process is properly closed. The table's persisted status is still PENDING with the group name, which no longer exists. After restart, the table is orphaned and stuck. Expected behavior: Tables in PLANNING/PENDING status whose resource group no longer exists should be automatically released to IDLE status during AMS startup recovery. ### Affects Versions 0.8.x ### What table formats are you seeing the problem on? Iceberg ### What engines are you seeing the problem on? AMS ### How to reproduce 1. Create a custom resource group (e.g., "custom_group") and assign some tables to it. 2. Write data to the tables so that they enter PENDING optimizing status. 3. Clear the tables' optimizer group config(`self-optimizing.enabled`=`false` and `self-optimizing.group`=`default`) 4. Restart AMS. 5. Observe that the affected tables remain stuck in PENDING status and are never optimized. <img width="880" height="262" alt="Image" src="https://github.com/user-attachments/assets/21f760cb-1cc7-4335-97ed-24fb37d1562c" /> ### Relevant log output ```shell ``` ### Anything else The problem occurs every time AMS is restarted when tables with non-existent groups are in PLANNING/PENDING status. The tables will remain stuck until manually reset. ### Are you willing to submit a PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's Code of Conduct -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
