Make table deletion idempotent#10625
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10625 +/- ##
============================================
- Coverage 70.37% 70.32% -0.05%
- Complexity 6495 6498 +3
============================================
Files 2106 2108 +2
Lines 113004 113638 +634
Branches 17026 17126 +100
============================================
+ Hits 79521 79918 +397
- Misses 27917 28113 +196
- Partials 5566 5607 +41
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 85 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
36486ba to
cd23fdf
Compare
cd23fdf to
25ebf03
Compare
|
@jtao15 can you also take a look please? |
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Do we need the TableDeletionControllerMessage? Can we make it similar to other controller jobs, and use a ZK record to store the progress of table delete so that it is accessible by any controller?
|
I am already storing progress in the ZK. That's how the deleteStatusAPI works. Without the message thought how are we supposed to return API response immediately? Other jobs are dealing with IS update only and not EV converge which can take extremely long. |
|
You may take a look at how rebalance task is handled |
This PR aims to solve the issue describe in #10603
A new flag
asyncis added to the table request.When set, we trigger table deletion via a background job and only return a job id. The table deletion then proceeds in background via a message handler on controller. The controller now waits for EV to converge and only then triggers deletion for segments and configs.
Also added a new API
/tables/deleteTableStatus/{jobId}to track the progress of deletion.It returns the response in the following format
{ "jobId":"01fe31f4-39ac-44f8-baaa-33289cf818cf", "segmentsPendingDeletion":[], "segmentsPendingDeletionCount":0, "messageCount":"1", "submissionTimeMs":"1681943216398", "jobType":"TABLE_DELETE", "tableName":"table0_REALTIME", "tableConfigDeleted":false }