amoro
amoro copied to clipboard
[Improvement]: Clear orphan table information
Search before asking
- [x] I have searched in the issues and found no similar issues.
What would you like to be improved?
With the growth of system runtime or abnormal interruptions during table registration and scheduling, the following types of redundant metadata may accumulate in the database:
- Orphan TableRuntime: runtime information exists in the database, but its corresponding tableIdentifier has been deleted or the primary table metadata is lost;
- Orphan TableIdentifier: only identifier information such as table name is stored in the database, and the complete runtime information is not established.
- Orphan Optimizing Metadata: includes residual optimizing data such as optimization process, task runtime information and optimization quota which are related to the deleted table and will continue to occupy resources if not cleaned up.
If we do not clean up this type of data, it will bring the following risks:
- Affecting the operational efficiency of the system when initializing TableRuntime and increasing the burden of metadata scanning;
- Mismatch between TableRuntime and TableIdentifier will interfere with the real judgment of table status and affect Amoro's subsequent update of table runtimes;
- When synchronizing new table to Amoro, redundant data in the database may lead to primary key conflicts and synchronization failure as mentioned in #3444;
- Affecting the results of WebUI API queries;
How should we improve?
- Clear orphan table information during initializing.
- Trigger rollback of doAsTransaction() in disposing tables when tableRuntime disposal fails.
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
Subtasks
- [x] #3554
- [x] #3556
Code of Conduct
- [x] I agree to follow this project's Code of Conduct