Skip to content

Commit

Permalink
WT-9824 Add testing to file manager WT connection configurations in t…
Browse files Browse the repository at this point in the history
…est/format (#8611)
  • Loading branch information
sonar3ddy committed Feb 15, 2023
1 parent 3121cb6 commit 7d60292
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 72 deletions.
2 changes: 1 addition & 1 deletion dist/s_clang_format.list
Expand Up @@ -17,4 +17,4 @@ src/os_posix/os_getopt.c
src/support/hash_city.c
src/support/hash_fnv.c
src/support/stat.c
test/format/config_def.c
test/format/format_config_def.c
145 changes: 74 additions & 71 deletions test/format/config.h
Expand Up @@ -78,75 +78,78 @@ typedef struct {
#define V_TABLE_DISK_FIRSTFIT 46
#define V_GLOBAL_DISK_MMAP 47
#define V_GLOBAL_DISK_MMAP_ALL 48
#define V_GLOBAL_FORMAT_ABORT 49
#define V_GLOBAL_FORMAT_INDEPENDENT_THREAD_RNG 50
#define V_GLOBAL_FORMAT_MAJOR_TIMEOUT 51
#define V_GLOBAL_IMPORT 52
#define V_GLOBAL_LOGGING 53
#define V_GLOBAL_LOGGING_COMPRESSION 54
#define V_GLOBAL_LOGGING_FILE_MAX 55
#define V_GLOBAL_LOGGING_PREALLOC 56
#define V_GLOBAL_LOGGING_REMOVE 57
#define V_TABLE_LSM_AUTO_THROTTLE 58
#define V_TABLE_LSM_BLOOM 59
#define V_TABLE_LSM_BLOOM_BIT_COUNT 60
#define V_TABLE_LSM_BLOOM_HASH_COUNT 61
#define V_TABLE_LSM_BLOOM_OLDEST 62
#define V_TABLE_LSM_CHUNK_SIZE 63
#define V_TABLE_LSM_MERGE_MAX 64
#define V_GLOBAL_LSM_WORKER_THREADS 65
#define V_GLOBAL_OPS_ALTER 66
#define V_GLOBAL_OPS_COMPACTION 67
#define V_GLOBAL_OPS_HS_CURSOR 68
#define V_TABLE_OPS_PCT_DELETE 69
#define V_TABLE_OPS_PCT_INSERT 70
#define V_TABLE_OPS_PCT_MODIFY 71
#define V_TABLE_OPS_PCT_READ 72
#define V_TABLE_OPS_PCT_WRITE 73
#define V_GLOBAL_OPS_BOUND_CURSOR 74
#define V_GLOBAL_OPS_PREPARE 75
#define V_GLOBAL_OPS_RANDOM_CURSOR 76
#define V_GLOBAL_OPS_SALVAGE 77
#define V_TABLE_OPS_TRUNCATE 78
#define V_GLOBAL_OPS_VERIFY 79
#define V_GLOBAL_QUIET 80
#define V_GLOBAL_RANDOM_DATA_SEED 81
#define V_GLOBAL_RANDOM_EXTRA_SEED 82
#define V_GLOBAL_RUNS_IN_MEMORY 83
#define V_TABLE_RUNS_MIRROR 84
#define V_GLOBAL_RUNS_OPS 85
#define V_GLOBAL_RUNS_PREDICTABLE_REPLAY 86
#define V_TABLE_RUNS_ROWS 87
#define V_TABLE_RUNS_SOURCE 88
#define V_GLOBAL_RUNS_TABLES 89
#define V_GLOBAL_RUNS_THREADS 90
#define V_GLOBAL_RUNS_TIMER 91
#define V_TABLE_RUNS_TYPE 92
#define V_GLOBAL_RUNS_VERIFY_FAILURE_DUMP 93
#define V_GLOBAL_STATISTICS_MODE 94
#define V_GLOBAL_STATISTICS_LOG_SOURCES 95
#define V_GLOBAL_STRESS_AGGRESSIVE_SWEEP 96
#define V_GLOBAL_STRESS_CHECKPOINT 97
#define V_GLOBAL_STRESS_CHECKPOINT_EVICT_PAGE 98
#define V_GLOBAL_STRESS_CHECKPOINT_PREPARE 99
#define V_GLOBAL_STRESS_EVICT_REPOSITION 100
#define V_GLOBAL_STRESS_FAILPOINT_EVICTION_FAIL_AFTER_RECONCILIATION 101
#define V_GLOBAL_STRESS_FAILPOINT_HS_DELETE_KEY_FROM_TS 102
#define V_GLOBAL_STRESS_HS_CHECKPOINT_DELAY 103
#define V_GLOBAL_STRESS_HS_SEARCH 104
#define V_GLOBAL_STRESS_HS_SWEEP 105
#define V_GLOBAL_STRESS_SLEEP_BEFORE_READ_OVERFLOW_ONPAGE 106
#define V_GLOBAL_STRESS_SPLIT_1 107
#define V_GLOBAL_STRESS_SPLIT_2 108
#define V_GLOBAL_STRESS_SPLIT_3 109
#define V_GLOBAL_STRESS_SPLIT_4 110
#define V_GLOBAL_STRESS_SPLIT_5 111
#define V_GLOBAL_STRESS_SPLIT_6 112
#define V_GLOBAL_STRESS_SPLIT_7 113
#define V_GLOBAL_TRANSACTION_IMPLICIT 114
#define V_GLOBAL_TRANSACTION_TIMESTAMPS 115
#define V_GLOBAL_WIREDTIGER_CONFIG 116
#define V_GLOBAL_WIREDTIGER_RWLOCK 117
#define V_GLOBAL_WIREDTIGER_LEAK_MEMORY 118
#define V_GLOBAL_FILE_MANAGER_CLOSE_HANDLE_MINIMUM 49
#define V_GLOBAL_FILE_MANAGER_CLOSE_IDLE_TIME 50
#define V_GLOBAL_FILE_MANAGER_CLOSE_SCAN_INTERVAL 51
#define V_GLOBAL_FORMAT_ABORT 52
#define V_GLOBAL_FORMAT_INDEPENDENT_THREAD_RNG 53
#define V_GLOBAL_FORMAT_MAJOR_TIMEOUT 54
#define V_GLOBAL_IMPORT 55
#define V_GLOBAL_LOGGING 56
#define V_GLOBAL_LOGGING_COMPRESSION 57
#define V_GLOBAL_LOGGING_FILE_MAX 58
#define V_GLOBAL_LOGGING_PREALLOC 59
#define V_GLOBAL_LOGGING_REMOVE 60
#define V_TABLE_LSM_AUTO_THROTTLE 61
#define V_TABLE_LSM_BLOOM 62
#define V_TABLE_LSM_BLOOM_BIT_COUNT 63
#define V_TABLE_LSM_BLOOM_HASH_COUNT 64
#define V_TABLE_LSM_BLOOM_OLDEST 65
#define V_TABLE_LSM_CHUNK_SIZE 66
#define V_TABLE_LSM_MERGE_MAX 67
#define V_GLOBAL_LSM_WORKER_THREADS 68
#define V_GLOBAL_OPS_ALTER 69
#define V_GLOBAL_OPS_COMPACTION 70
#define V_GLOBAL_OPS_HS_CURSOR 71
#define V_TABLE_OPS_PCT_DELETE 72
#define V_TABLE_OPS_PCT_INSERT 73
#define V_TABLE_OPS_PCT_MODIFY 74
#define V_TABLE_OPS_PCT_READ 75
#define V_TABLE_OPS_PCT_WRITE 76
#define V_GLOBAL_OPS_BOUND_CURSOR 77
#define V_GLOBAL_OPS_PREPARE 78
#define V_GLOBAL_OPS_RANDOM_CURSOR 79
#define V_GLOBAL_OPS_SALVAGE 80
#define V_TABLE_OPS_TRUNCATE 81
#define V_GLOBAL_OPS_VERIFY 82
#define V_GLOBAL_QUIET 83
#define V_GLOBAL_RANDOM_DATA_SEED 84
#define V_GLOBAL_RANDOM_EXTRA_SEED 85
#define V_GLOBAL_RUNS_IN_MEMORY 86
#define V_TABLE_RUNS_MIRROR 87
#define V_GLOBAL_RUNS_OPS 88
#define V_GLOBAL_RUNS_PREDICTABLE_REPLAY 89
#define V_TABLE_RUNS_ROWS 90
#define V_TABLE_RUNS_SOURCE 91
#define V_GLOBAL_RUNS_TABLES 92
#define V_GLOBAL_RUNS_THREADS 93
#define V_GLOBAL_RUNS_TIMER 94
#define V_TABLE_RUNS_TYPE 95
#define V_GLOBAL_RUNS_VERIFY_FAILURE_DUMP 96
#define V_GLOBAL_STATISTICS_MODE 97
#define V_GLOBAL_STATISTICS_LOG_SOURCES 98
#define V_GLOBAL_STRESS_AGGRESSIVE_SWEEP 99
#define V_GLOBAL_STRESS_CHECKPOINT 100
#define V_GLOBAL_STRESS_CHECKPOINT_EVICT_PAGE 101
#define V_GLOBAL_STRESS_CHECKPOINT_PREPARE 102
#define V_GLOBAL_STRESS_EVICT_REPOSITION 103
#define V_GLOBAL_STRESS_FAILPOINT_EVICTION_FAIL_AFTER_RECONCILIATION 104
#define V_GLOBAL_STRESS_FAILPOINT_HS_DELETE_KEY_FROM_TS 105
#define V_GLOBAL_STRESS_HS_CHECKPOINT_DELAY 106
#define V_GLOBAL_STRESS_HS_SEARCH 107
#define V_GLOBAL_STRESS_HS_SWEEP 108
#define V_GLOBAL_STRESS_SLEEP_BEFORE_READ_OVERFLOW_ONPAGE 109
#define V_GLOBAL_STRESS_SPLIT_1 110
#define V_GLOBAL_STRESS_SPLIT_2 111
#define V_GLOBAL_STRESS_SPLIT_3 112
#define V_GLOBAL_STRESS_SPLIT_4 113
#define V_GLOBAL_STRESS_SPLIT_5 114
#define V_GLOBAL_STRESS_SPLIT_6 115
#define V_GLOBAL_STRESS_SPLIT_7 116
#define V_GLOBAL_TRANSACTION_IMPLICIT 117
#define V_GLOBAL_TRANSACTION_TIMESTAMPS 118
#define V_GLOBAL_WIREDTIGER_CONFIG 119
#define V_GLOBAL_WIREDTIGER_RWLOCK 120
#define V_GLOBAL_WIREDTIGER_LEAK_MEMORY 121

#define V_ELEMENT_COUNT 119
#define V_ELEMENT_COUNT 122
7 changes: 7 additions & 0 deletions test/format/config.sh
Expand Up @@ -169,6 +169,13 @@ CONFIG configuration_list[] = {
{"disk.mmap_all", "configure mmap operations (read and write)", C_BOOL, 5, 0, 0}
/* Test format can only handle 32 tables so we use a maximum value of 32 here. */
{"file_manager.close_handle_minimum", "number of handles open before the file manager will look for handles to close", 0x0, 0, 32, 32}
{"file_manager.close_idle_time", "amount of time in seconds a file handle needs to be idle before attempting to close it. A setting of 0 means that idle handles are not closed", 0x0, 0, 60, 100000}
{"file_manager.close_scan_interval", "interval in seconds at which to check for files that are inactive and close them", 0x0, 0, 30, 100000}
{"format.abort", "drop core during timed run", C_BOOL, 0, 0, 0}
{"format.independent_thread_rng", "configure independent thread RNG space", C_BOOL, 75, 0, 0}
Expand Down
14 changes: 14 additions & 0 deletions test/format/format_config_def.c
Expand Up @@ -147,6 +147,20 @@ CONFIG configuration_list[] = {{"assert.read_timestamp", "assert read_timestamp"
{"disk.mmap_all", "configure mmap operations (read and write)", C_BOOL, 5, 0, 0,
V_GLOBAL_DISK_MMAP_ALL},

/* Test format can only handle 32 tables so we use a maximum value of 32 here. */
{"file_manager.close_handle_minimum",
"number of handles open before the file manager will look for handles to close", 0x0, 0, 32, 32,
V_GLOBAL_FILE_MANAGER_CLOSE_HANDLE_MINIMUM},

{"file_manager.close_idle_time",
"amount of time in seconds a file handle needs to be idle before attempting to close it. A "
"setting of 0 means that idle handles are not closed",
0x0, 0, 60, 100000, V_GLOBAL_FILE_MANAGER_CLOSE_IDLE_TIME},

{"file_manager.close_scan_interval",
"interval in seconds at which to check for files that are inactive and close them", 0x0, 0, 30,
100000, V_GLOBAL_FILE_MANAGER_CLOSE_SCAN_INTERVAL},

{"format.abort", "drop core during timed run", C_BOOL, 0, 0, 0, V_GLOBAL_FORMAT_ABORT},

{"format.independent_thread_rng", "configure independent thread RNG space", C_BOOL, 75, 0, 0,
Expand Down
23 changes: 23 additions & 0 deletions test/format/wts.c
Expand Up @@ -196,6 +196,23 @@ configure_timing_stress(char **p, size_t max)
CONFIG_APPEND(*p, "]");
}

/*
* configure_file_manager --
* Configure file manager settings.
*/
static void
configure_file_manager(char **p, size_t max)
{
CONFIG_APPEND(*p, ",file_manager=[");
if (GV(FILE_MANAGER_CLOSE_HANDLE_MINIMUM) != 0)
CONFIG_APPEND(*p, ",close_handle_minimum=%" PRIu32, GV(FILE_MANAGER_CLOSE_HANDLE_MINIMUM));
if (GV(FILE_MANAGER_CLOSE_IDLE_TIME) != 0)
CONFIG_APPEND(*p, ",close_idle_time=%" PRIu32, GV(FILE_MANAGER_CLOSE_IDLE_TIME));
if (GV(FILE_MANAGER_CLOSE_SCAN_INTERVAL) != 0)
CONFIG_APPEND(*p, ",close_scan_interval=%" PRIu32, GV(FILE_MANAGER_CLOSE_SCAN_INTERVAL));
CONFIG_APPEND(*p, "]");
}

/*
* configure_debug_mode --
* Configure debug settings.
Expand Down Expand Up @@ -324,6 +341,9 @@ create_database(const char *home, WT_CONNECTION **connp)
/* Optional timing stress. */
configure_timing_stress(&p, max);

/* Optional file manager. */
configure_file_manager(&p, max);

/* Optional debug mode. */
configure_debug_mode(&p, max);

Expand Down Expand Up @@ -526,6 +546,9 @@ wts_open(const char *home, WT_CONNECTION **connp, bool verify_metadata)
/* Optional timing stress. */
configure_timing_stress(&p, max);

/* Optional file manager. */
configure_file_manager(&p, max);

/* Optional debug mode. */
configure_debug_mode(&p, max);

Expand Down

0 comments on commit 7d60292

Please sign in to comment.