[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:
Depends
depends on WT-10897 Make WT::compact command more test fr... Closed
depends on WT-9636 Provide a way for an application to i... Closed
Problem/Incident
causes SERVER-75917 Follow-up ticket to add JS test for M... Closed
Related
related to SERVER-79869 The WiredTiger event handler is not u... Closed
is related to SERVER-75814 MDB compact commands running in testi... Open
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. WT-9636 added the ability to interrupt WT::compact, so we should make use of it here.



 Comments   
Comment by Githook User [ 12/Apr/23 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-70201 Add interruptibility to WT::compact commands from the MDB layer
Branch: master
https://github.com/mongodb/mongo/commit/1cf4d52fdd4f0ec9c30451a7b0244fdd5581a4e4

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.

Generated at Thu Feb 08 06:15:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.