Skip to content

Commit

Permalink
Import wiredtiger: 7db45aa489365d49d0f90e4089a20a3ffd6af29d from bran…
Browse files Browse the repository at this point in the history
…ch mongodb-master

ref: 7465e7e9fa..7db45aa489
for: 6.1.0-rc0

WT-9495 Create debug flag to make checkpoint perform eviction on reconcilling pages (#8077)
  • Loading branch information
quchenhao authored and Evergreen Agent committed Jun 29, 2022
1 parent 539c993 commit 40b58c8
Show file tree
Hide file tree
Showing 12 changed files with 459 additions and 78 deletions.
11 changes: 6 additions & 5 deletions src/third_party/wiredtiger/dist/api_data.py
Expand Up @@ -780,11 +780,12 @@ def __ge__(self, other):
stress testing of WiredTiger.''',
type='list', undoc=True,
choices=[
'aggressive_sweep', 'backup_rename', 'checkpoint_reserved_txnid_delay', 'checkpoint_slow',
'checkpoint_stop', 'compact_slow', 'evict_reposition',
'failpoint_history_store_delete_key_from_ts', 'history_store_checkpoint_delay',
'history_store_search', 'history_store_sweep_race', 'prepare_checkpoint_delay', 'split_1',
'split_2', 'split_3', 'split_4', 'split_5', 'split_6', 'split_7', 'tiered_flush_finish']),
'aggressive_sweep', 'backup_rename', 'checkpoint_evict_page',
'checkpoint_reserved_txnid_delay', 'checkpoint_slow', 'checkpoint_stop', 'compact_slow',
'evict_reposition','failpoint_history_store_delete_key_from_ts',
'history_store_checkpoint_delay', 'history_store_search', 'history_store_sweep_race',
'prepare_checkpoint_delay', 'split_1', 'split_2', 'split_3', 'split_4', 'split_5',
'split_6', 'split_7', 'tiered_flush_finish']),
Config('verbose', '[]', r'''
enable messages for various subsystems and operations. Options are given as a list,
where each message type can optionally define an associated verbosity level, such as
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/wiredtiger/import.data
Expand Up @@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
"commit": "7465e7e9fa01fa69c92dffc0e1d303f20adedf17"
"commit": "7db45aa489365d49d0f90e4089a20a3ffd6af29d"
}
4 changes: 3 additions & 1 deletion src/third_party/wiredtiger/src/btree/bt_sync.c
Expand Up @@ -610,7 +610,9 @@ __wt_sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
* Once the transaction has given up it's snapshot it is no longer safe to reconcile
* pages. That happens prior to the final metadata checkpoint.
*/
if (F_ISSET(walk, WT_REF_FLAG_LEAF) && page->read_gen == WT_READGEN_WONT_NEED &&
if (F_ISSET(walk, WT_REF_FLAG_LEAF) &&
(page->read_gen == WT_READGEN_WONT_NEED ||
FLD_ISSET(conn->timing_stress_flags, WT_TIMING_STRESS_CHECKPOINT_EVICT_PAGE)) &&
!tried_eviction && F_ISSET(session->txn, WT_TXN_HAS_SNAPSHOT)) {
ret = __wt_page_release_evict(session, walk, 0);
walk = NULL;
Expand Down
25 changes: 15 additions & 10 deletions src/third_party/wiredtiger/src/config/config_def.c
Expand Up @@ -154,8 +154,9 @@ static const WT_CONFIG_CHECK confchk_WT_CONNECTION_reconfigure[] = {
confchk_WT_CONNECTION_reconfigure_tiered_storage_subconfigs, 1},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_reserved_txnid_delay\",\"checkpoint_slow\","
"\"checkpoint_stop\",\"compact_slow\",\"evict_reposition\","
"\"checkpoint_evict_page\",\"checkpoint_reserved_txnid_delay\","
"\"checkpoint_slow\",\"checkpoint_stop\",\"compact_slow\","
"\"evict_reposition\","
"\"failpoint_history_store_delete_key_from_ts\","
"\"history_store_checkpoint_delay\",\"history_store_search\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
Expand Down Expand Up @@ -895,8 +896,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
{"tiered_storage", "category", NULL, NULL, confchk_tiered_storage_subconfigs, 7},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_reserved_txnid_delay\",\"checkpoint_slow\","
"\"checkpoint_stop\",\"compact_slow\",\"evict_reposition\","
"\"checkpoint_evict_page\",\"checkpoint_reserved_txnid_delay\","
"\"checkpoint_slow\",\"checkpoint_stop\",\"compact_slow\","
"\"evict_reposition\","
"\"failpoint_history_store_delete_key_from_ts\","
"\"history_store_checkpoint_delay\",\"history_store_search\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
Expand Down Expand Up @@ -978,8 +980,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = {
{"tiered_storage", "category", NULL, NULL, confchk_tiered_storage_subconfigs, 7},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_reserved_txnid_delay\",\"checkpoint_slow\","
"\"checkpoint_stop\",\"compact_slow\",\"evict_reposition\","
"\"checkpoint_evict_page\",\"checkpoint_reserved_txnid_delay\","
"\"checkpoint_slow\",\"checkpoint_stop\",\"compact_slow\","
"\"evict_reposition\","
"\"failpoint_history_store_delete_key_from_ts\","
"\"history_store_checkpoint_delay\",\"history_store_search\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
Expand Down Expand Up @@ -1059,8 +1062,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = {
{"tiered_storage", "category", NULL, NULL, confchk_tiered_storage_subconfigs, 7},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_reserved_txnid_delay\",\"checkpoint_slow\","
"\"checkpoint_stop\",\"compact_slow\",\"evict_reposition\","
"\"checkpoint_evict_page\",\"checkpoint_reserved_txnid_delay\","
"\"checkpoint_slow\",\"checkpoint_stop\",\"compact_slow\","
"\"evict_reposition\","
"\"failpoint_history_store_delete_key_from_ts\","
"\"history_store_checkpoint_delay\",\"history_store_search\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
Expand Down Expand Up @@ -1138,8 +1142,9 @@ static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = {
{"tiered_storage", "category", NULL, NULL, confchk_tiered_storage_subconfigs, 7},
{"timing_stress_for_test", "list", NULL,
"choices=[\"aggressive_sweep\",\"backup_rename\","
"\"checkpoint_reserved_txnid_delay\",\"checkpoint_slow\","
"\"checkpoint_stop\",\"compact_slow\",\"evict_reposition\","
"\"checkpoint_evict_page\",\"checkpoint_reserved_txnid_delay\","
"\"checkpoint_slow\",\"checkpoint_stop\",\"compact_slow\","
"\"evict_reposition\","
"\"failpoint_history_store_delete_key_from_ts\","
"\"history_store_checkpoint_delay\",\"history_store_search\","
"\"history_store_sweep_race\",\"prepare_checkpoint_delay\","
Expand Down
1 change: 1 addition & 0 deletions src/third_party/wiredtiger/src/conn/conn_api.c
Expand Up @@ -2248,6 +2248,7 @@ __wt_timing_stress_config(WT_SESSION_IMPL *session, const char *cfg[])
static const WT_NAME_FLAG stress_types[] = {
{"aggressive_sweep", WT_TIMING_STRESS_AGGRESSIVE_SWEEP},
{"backup_rename", WT_TIMING_STRESS_BACKUP_RENAME},
{"checkpoint_evict_page", WT_TIMING_STRESS_CHECKPOINT_EVICT_PAGE},
{"checkpoint_reserved_txnid_delay", WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY},
{"checkpoint_slow", WT_TIMING_STRESS_CHECKPOINT_SLOW},
{"checkpoint_stop", WT_TIMING_STRESS_CHECKPOINT_STOP},
Expand Down
41 changes: 21 additions & 20 deletions src/third_party/wiredtiger/src/include/connection.h
Expand Up @@ -579,26 +579,27 @@ struct __wt_connection_impl {
* Variable with flags for which subsystems the diagnostic stress timing delays have been requested.
*/
/* AUTOMATIC FLAG VALUE GENERATION START 0 */
#define WT_TIMING_STRESS_AGGRESSIVE_SWEEP 0x00001u
#define WT_TIMING_STRESS_BACKUP_RENAME 0x00002u
#define WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 0x00004u
#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x00008u
#define WT_TIMING_STRESS_CHECKPOINT_STOP 0x00010u
#define WT_TIMING_STRESS_COMPACT_SLOW 0x00020u
#define WT_TIMING_STRESS_EVICT_REPOSITION 0x00040u
#define WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS 0x00080u
#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x00100u
#define WT_TIMING_STRESS_HS_SEARCH 0x00200u
#define WT_TIMING_STRESS_HS_SWEEP 0x00400u
#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x00800u
#define WT_TIMING_STRESS_SPLIT_1 0x01000u
#define WT_TIMING_STRESS_SPLIT_2 0x02000u
#define WT_TIMING_STRESS_SPLIT_3 0x04000u
#define WT_TIMING_STRESS_SPLIT_4 0x08000u
#define WT_TIMING_STRESS_SPLIT_5 0x10000u
#define WT_TIMING_STRESS_SPLIT_6 0x20000u
#define WT_TIMING_STRESS_SPLIT_7 0x40000u
#define WT_TIMING_STRESS_TIERED_FLUSH_FINISH 0x80000u
#define WT_TIMING_STRESS_AGGRESSIVE_SWEEP 0x000001u
#define WT_TIMING_STRESS_BACKUP_RENAME 0x000002u
#define WT_TIMING_STRESS_CHECKPOINT_EVICT_PAGE 0x000004u
#define WT_TIMING_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 0x000008u
#define WT_TIMING_STRESS_CHECKPOINT_SLOW 0x000010u
#define WT_TIMING_STRESS_CHECKPOINT_STOP 0x000020u
#define WT_TIMING_STRESS_COMPACT_SLOW 0x000040u
#define WT_TIMING_STRESS_EVICT_REPOSITION 0x000080u
#define WT_TIMING_STRESS_FAILPOINT_HISTORY_STORE_DELETE_KEY_FROM_TS 0x000100u
#define WT_TIMING_STRESS_HS_CHECKPOINT_DELAY 0x000200u
#define WT_TIMING_STRESS_HS_SEARCH 0x000400u
#define WT_TIMING_STRESS_HS_SWEEP 0x000800u
#define WT_TIMING_STRESS_PREPARE_CHECKPOINT_DELAY 0x001000u
#define WT_TIMING_STRESS_SPLIT_1 0x002000u
#define WT_TIMING_STRESS_SPLIT_2 0x004000u
#define WT_TIMING_STRESS_SPLIT_3 0x008000u
#define WT_TIMING_STRESS_SPLIT_4 0x010000u
#define WT_TIMING_STRESS_SPLIT_5 0x020000u
#define WT_TIMING_STRESS_SPLIT_6 0x040000u
#define WT_TIMING_STRESS_SPLIT_7 0x080000u
#define WT_TIMING_STRESS_TIERED_FLUSH_FINISH 0x100000u
/* AUTOMATIC FLAG VALUE GENERATION STOP 32 */
uint32_t timing_stress_flags;

Expand Down
41 changes: 21 additions & 20 deletions src/third_party/wiredtiger/test/format/config.h
Expand Up @@ -113,24 +113,25 @@ typedef struct {
#define V_GLOBAL_STATISTICS_SERVER 81
#define V_GLOBAL_STRESS_AGGRESSIVE_SWEEP 82
#define V_GLOBAL_STRESS_CHECKPOINT 83
#define V_GLOBAL_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 84
#define V_GLOBAL_STRESS_CHECKPOINT_PREPARE 85
#define V_GLOBAL_STRESS_EVICT_REPOSITION 86
#define V_GLOBAL_STRESS_FAILPOINT_HS_DELETE_KEY_FROM_TS 87
#define V_GLOBAL_STRESS_HS_CHECKPOINT_DELAY 88
#define V_GLOBAL_STRESS_HS_SEARCH 89
#define V_GLOBAL_STRESS_HS_SWEEP 90
#define V_GLOBAL_STRESS_SPLIT_1 91
#define V_GLOBAL_STRESS_SPLIT_2 92
#define V_GLOBAL_STRESS_SPLIT_3 93
#define V_GLOBAL_STRESS_SPLIT_4 94
#define V_GLOBAL_STRESS_SPLIT_5 95
#define V_GLOBAL_STRESS_SPLIT_6 96
#define V_GLOBAL_STRESS_SPLIT_7 97
#define V_GLOBAL_TRANSACTION_IMPLICIT 98
#define V_GLOBAL_TRANSACTION_TIMESTAMPS 99
#define V_GLOBAL_WIREDTIGER_CONFIG 100
#define V_GLOBAL_WIREDTIGER_RWLOCK 101
#define V_GLOBAL_WIREDTIGER_LEAK_MEMORY 102
#define V_GLOBAL_STRESS_CHECKPOINT_EVICT_PAGE 84
#define V_GLOBAL_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY 85
#define V_GLOBAL_STRESS_CHECKPOINT_PREPARE 86
#define V_GLOBAL_STRESS_EVICT_REPOSITION 87
#define V_GLOBAL_STRESS_FAILPOINT_HS_DELETE_KEY_FROM_TS 88
#define V_GLOBAL_STRESS_HS_CHECKPOINT_DELAY 89
#define V_GLOBAL_STRESS_HS_SEARCH 90
#define V_GLOBAL_STRESS_HS_SWEEP 91
#define V_GLOBAL_STRESS_SPLIT_1 92
#define V_GLOBAL_STRESS_SPLIT_2 93
#define V_GLOBAL_STRESS_SPLIT_3 94
#define V_GLOBAL_STRESS_SPLIT_4 95
#define V_GLOBAL_STRESS_SPLIT_5 96
#define V_GLOBAL_STRESS_SPLIT_6 97
#define V_GLOBAL_STRESS_SPLIT_7 98
#define V_GLOBAL_TRANSACTION_IMPLICIT 99
#define V_GLOBAL_TRANSACTION_TIMESTAMPS 100
#define V_GLOBAL_WIREDTIGER_CONFIG 101
#define V_GLOBAL_WIREDTIGER_RWLOCK 102
#define V_GLOBAL_WIREDTIGER_LEAK_MEMORY 103

#define V_ELEMENT_COUNT 103
#define V_ELEMENT_COUNT 104
2 changes: 2 additions & 0 deletions src/third_party/wiredtiger/test/format/config.sh
Expand Up @@ -244,6 +244,8 @@ CONFIG configuration_list[] = {
{"stress.checkpoint", "stress checkpoints", C_BOOL, 2, 0, 0}
{"stress.checkpoint_evict_page", "stress force checkpoint to evict all reconciling pages", C_BOOL, 2, 0, 0}
{"stress.checkpoint_reserved_txnid_delay", "stress checkpoint invisible transaction id delay", C_BOOL, 2, 0, 0}
{"stress.checkpoint_prepare", "stress checkpoint prepare", C_BOOL, 2, 0, 0}
Expand Down
3 changes: 3 additions & 0 deletions src/third_party/wiredtiger/test/format/config_def.c
Expand Up @@ -260,6 +260,9 @@ CONFIG configuration_list[] = {
{"stress.checkpoint", "stress checkpoints",
C_BOOL, 2, 0, 0, V_GLOBAL_STRESS_CHECKPOINT},

{"stress.checkpoint_evict_page", "stress force checkpoint to evict all reconciling pages",
C_BOOL, 2, 0, 0, V_GLOBAL_STRESS_CHECKPOINT_EVICT_PAGE},

{"stress.checkpoint_reserved_txnid_delay", "stress checkpoint invisible transaction id delay",
C_BOOL, 2, 0, 0, V_GLOBAL_STRESS_CHECKPOINT_RESERVED_TXNID_DELAY},

Expand Down

0 comments on commit 40b58c8

Please sign in to comment.