[SERVER-70201] Make compact killable Created: 04/Oct/22 Updated: 29/Oct/23 Resolved: 12/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Gregory Noma | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | RDY | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Assigned Teams: |
Storage Execution
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Execution Team 2023-03-20, Execution Team 2023-04-03, Execution Team 2023-04-17 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
|
The long-running part of the compact command is when we actually call into WT::compact. This means there currently a compact command essentially can't be killed once it has started. |
| Comments |
| Comment by Githook User [ 12/Apr/23 ] |
|
Author: {'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}Message: |
| Comment by Dianna Hohensee (Inactive) [ 30/Mar/23 ] |
|
I've taken a look at the code and spoken with Sue about how the WT interrupt logic works. In summary, the MDB layer can specify a callback once in wiredtiger_open(), which will then be checked periodically internally by all WT compact operations. MDB cannot set a callback per WT compact operation. Relatively simple solution: if killOp comes in targeting a MDB compact command, then we could set global state to have any active compact operation in WT quit. The interrupted MDB compact command thread would have to unset the global state to fail WT compact operations before exiting. Relatively fancy solution: create a new global registry. The registry will correlate MDB compact command operation ID to the WT session ID running the WT compact command. killOp can then cause the MDB compact opid/sessionID in the registry to be set to interrupted, and the WT compact callback will error if the sessionID is set to interrupted. The simple solution is not a nice user experience and isn't really a stepping stone to the fancy solution. I'd recommend just doing all the work in the first place. |