-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
-
Execution NAMR Team 2023-08-21
The WiredTiger team tried to perform a drop yesterday, see the patch build which contains failures related to compact testing in MDB.
When compaction is performed, we check periodically if it has been interrupted by the application or if the timeout (if configured) has elapsed, see here.
With WT-11434, we are now doing those checks before taking a checkpoint as part of compaction, see here.
To know whether compaction has been interrupted by the application, we check the event handler.
There was some work done related to this through SERVER-70201 and the issue is in this new code here:
OperationContext* opCtx = reinterpret_cast<OperationContext*>(session->app_private); invariant(opCtx);
The session->app_private field is set only if a SessionDataRAII is constructed and used for the compact operation, which is the case here.
However, there is another call to compact in the MDB layer such as in wiredtiger_util_test.cpp that is not using the SessionDataRAII so when the event handler is checked, it crashes with the invariant. There might be other calls to compact that would lead to the issue.
After checking why it was not failing prior to WT-11434, the code that triggers the event handler is not executed and this might be related to SERVER-75814.
The suggested code changes are the following ones:
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp index bda44e1e9ac..11e94fde9f9 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_util.cpp @@ -862,12 +862,11 @@ int mdb_handle_general(WT_EVENT_HANDLER* handler, WT_SESSION* session, WT_EVENT_TYPE type, void* arg) { - if (type != WT_EVENT_COMPACT_CHECK) { + if (type != WT_EVENT_COMPACT_CHECK || session == nullptr || session->app_private == nullptr) { return 0; } OperationContext* opCtx = reinterpret_cast<OperationContext*>(session->app_private); - invariant(opCtx); Status status = opCtx->checkForInterruptNoAssert(); if (!status.isOK()) {
- is related to
-
SERVER-75814 MDB compact commands running in testing aren't actually exercising WT compact because the data size is too small and WT skips it
- Open
-
WT-11434 Check if foreground compaction has been interrupted when taking checkpoints
- Closed
-
SERVER-70201 Make compact killable
- Closed