-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Compaction
-
None
-
3
-
Joker - StorEng - 2023-10-17
In WT-11524, we introduce the following code:
/* If compaction has been interrupted, we return WT_ERROR to the caller. */ if (session == conn->background_compact.session) { background_compaction = true; /* Only check for interruption when the connection is not being opened/closed. */ if (!F_ISSET(conn, WT_CONN_CLOSING | WT_CONN_MINIMAL)) { __wt_spin_lock(session, &conn->background_compact.lock); if (!conn->background_compact.running) ret = WT_ERROR; __wt_spin_unlock(session, &conn->background_compact.lock); } }
We are killing compaction if it has been interrupted by the caller but only if we are not closing the connection which can be unexpected. This code slows down the connection to be closed if background compaction has work to do since the connection will wait for it to finish.
The motivation of WT-11524 was not to print a WT_ERROR message. We are now printing a warning when compaction is interrupted by the application. When closing the connection, we could either keep the warning or reduce the log level to a notice.
- is related to
-
WT-11524 Log a warning instead of an error when compaction is interrupted
- Closed