Import wiredtiger: 9e0b76e3798253f437bdd221ba0e89889fa8d23b from branch mongodb-master (#45289)

Co-authored-by: wt-vendoring-bot <wt-vendoring-bot@mongodb.com>
GitOrigin-RevId: feb31c85f1a16c618e5f5de366e704adedce18b0
This commit is contained in:
wt-vendoring-bot[bot] 2025-12-16 15:42:12 +11:00 committed by MongoDB Bot
parent bf61a77f0b
commit 96eeda68e1
24 changed files with 1790 additions and 1521 deletions

View File

@ -644,6 +644,10 @@ connection_runtime_config = [
if true, background compact aggressively removes compact statistics for a file and
decreases the max amount of time a file can be skipped for.''',
type='boolean'),
Config('crash_point_colgroup', 'false', r'''
if true, force crash in table creation while creating colgroup metadata entry. This is
intended for testing purposes only.''',
type='boolean'),
Config('corruption_abort', 'true', r'''
if true and built in diagnostic mode, dump core in the case of data corruption''',
type='boolean'),

View File

@ -201,13 +201,17 @@ conn_stats = [
##########################################
BackgroundCompactStat('background_compact_bytes_recovered', 'background compact recovered bytes', 'no_scale'),
BackgroundCompactStat('background_compact_ema', 'background compact moving average of bytes rewritten', 'no_scale'),
BackgroundCompactStat('background_compact_exclude', 'background compact skipped file as it is part of the exclude list', 'no_scale'),
BackgroundCompactStat('background_compact_fail', 'background compact failed calls', 'no_scale'),
BackgroundCompactStat('background_compact_fail_cache_pressure', 'background compact failed calls due to cache pressure', 'no_scale'),
BackgroundCompactStat('background_compact_files_tracked', 'number of files tracked by background compaction', 'no_scale'),
BackgroundCompactStat('background_compact_interrupted', 'background compact interrupted', 'no_scale'),
BackgroundCompactStat('background_compact_running', 'background compact running', 'no_scale'),
BackgroundCompactStat('background_compact_skipped', 'background compact skipped file as not meeting requirements for compaction', 'no_scale'),
BackgroundCompactStat('background_compact_skipped', 'background compact skipped file, not meeting requirements for compaction', 'no_scale'),
BackgroundCompactStat('background_compact_skipped_exclude', 'background compact skipped file, it is part of the exclude list', 'no_scale'),
BackgroundCompactStat('background_compact_skipped_missing_permissions', 'background compact skipped, there is a permissions issue', 'no_scale'),
BackgroundCompactStat('background_compact_skipped_no_such_file', 'background compact skipped, no such file exists', 'no_scale'),
BackgroundCompactStat('background_compact_skipped_small_file', 'background compact skipped file, it is smaller than 1MB in size', 'no_scale'),
BackgroundCompactStat('background_compact_skipped_unsuccessful', 'background compact skipped, last compact was unsuccessful/less successful than average', 'no_scale'),
BackgroundCompactStat('background_compact_sleep_cache_pressure', 'background compact sleeps due to cache pressure', 'no_scale'),
BackgroundCompactStat('background_compact_success', 'background compact successful calls', 'no_scale'),
BackgroundCompactStat('background_compact_timeout', 'background compact timeout', 'no_scale'),

View File

@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger",
"branch": "mongodb-master",
"commit": "f066b860b41d0a2c955823653d326536a007a175"
"commit": "9e0b76e3798253f437bdd221ba0e89889fa8d23b"
}

File diff suppressed because it is too large Load Diff

View File

@ -2205,6 +2205,12 @@ __wti_debug_mode_config(WT_SESSION_IMPL *session, const char *cfg[])
else
FLD_CLR(conn->debug_flags, WT_CONN_DEBUG_CORRUPTION_ABORT);
WT_RET(__wt_config_gets(session, cfg, "debug_mode.crash_point_colgroup", &cval));
if (cval.val)
FLD_SET(conn->debug_flags, WT_CONN_DEBUG_CRASH_POINT_COLGROUP);
else
FLD_CLR(conn->debug_flags, WT_CONN_DEBUG_CRASH_POINT_COLGROUP);
WT_RET(__wt_config_gets(session, cfg, "debug_mode.cursor_copy", &cval));
if (cval.val)
FLD_SET(conn->debug_flags, WT_CONN_DEBUG_CURSOR_COPY);

View File

@ -248,7 +248,7 @@ __background_compact_should_skip(WT_SESSION_IMPL *session, const char *uri, int6
/* Check if the file is excluded. */
if (__background_compact_exclude(session, uri)) {
WT_STAT_CONN_INCR(session, background_compact_exclude);
WT_STAT_CONN_INCR(session, background_compact_skipped_exclude);
*skipp = true;
return (0);
}
@ -260,6 +260,10 @@ __background_compact_should_skip(WT_SESSION_IMPL *session, const char *uri, int6
/* Ignore the error if the file no longer exists or in case of permission issues. */
if (ret == ENOENT || ret == EACCES) {
if (ret == ENOENT)
WT_STAT_CONN_INCR(session, background_compact_skipped_no_such_file);
else
WT_STAT_CONN_INCR(session, background_compact_skipped_missing_permissions);
*skipp = true;
return (0);
}
@ -267,7 +271,7 @@ __background_compact_should_skip(WT_SESSION_IMPL *session, const char *uri, int6
WT_RET(ret);
if (file_size <= WT_MEGABYTE) {
WT_STAT_CONN_INCR(session, background_compact_skipped);
WT_STAT_CONN_INCR(session, background_compact_skipped_small_file);
*skipp = true;
return (0);
}
@ -301,7 +305,7 @@ __background_compact_should_skip(WT_SESSION_IMPL *session, const char *uri, int6
compact_stat->bytes_rewritten < conn->background_compact.bytes_rewritten_ema) {
compact_stat->skip_count++;
conn->background_compact.files_skipped++;
WT_STAT_CONN_INCR(session, background_compact_skipped);
WT_STAT_CONN_INCR(session, background_compact_skipped_unsuccessful);
*skipp = true;
return (0);
}
@ -500,6 +504,7 @@ __background_compact_find_next_uri(WT_SESSION_IMPL *session, WT_ITEM *uri, WT_IT
WT_ERR(__background_compact_should_skip(session, key, id.val, &skip));
if (!skip)
break;
WT_STAT_CONN_INCR(session, background_compact_skipped);
}
} while ((ret = cursor->next(cursor)) == 0);
WT_ERR(ret);

View File

@ -155,7 +155,7 @@ WT_CONF_API_DECLARE(WT_CONNECTION, debug_info, 1, 8);
WT_CONF_API_DECLARE(WT_CONNECTION, load_extension, 1, 4);
WT_CONF_API_DECLARE(WT_CONNECTION, open_session, 3, 9);
WT_CONF_API_DECLARE(WT_CONNECTION, query_timestamp, 1, 1);
WT_CONF_API_DECLARE(WT_CONNECTION, reconfigure, 20, 126);
WT_CONF_API_DECLARE(WT_CONNECTION, reconfigure, 20, 127);
WT_CONF_API_DECLARE(WT_CONNECTION, rollback_to_stable, 1, 2);
WT_CONF_API_DECLARE(WT_CONNECTION, set_timestamp, 1, 4);
WT_CONF_API_DECLARE(WT_CURSOR, bound, 1, 3);
@ -186,10 +186,10 @@ WT_CONF_API_DECLARE(object, meta, 7, 71);
WT_CONF_API_DECLARE(table, meta, 2, 13);
WT_CONF_API_DECLARE(tier, meta, 7, 72);
WT_CONF_API_DECLARE(tiered, meta, 7, 74);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open, 25, 197);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_all, 25, 198);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_basecfg, 25, 192);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_usercfg, 25, 191);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open, 25, 198);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_all, 25, 199);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_basecfg, 25, 193);
WT_CONF_API_DECLARE(GLOBAL, wiredtiger_open_usercfg, 25, 192);
#define WT_CONF_API_ELEMENTS 57

View File

@ -26,43 +26,43 @@
#define WT_CONF_ID_Disaggregated 20ULL
#define WT_CONF_ID_Dump_version 131ULL
#define WT_CONF_ID_Encryption 22ULL
#define WT_CONF_ID_Eviction 241ULL
#define WT_CONF_ID_File_manager 260ULL
#define WT_CONF_ID_Eviction 242ULL
#define WT_CONF_ID_File_manager 261ULL
#define WT_CONF_ID_Flush_tier 182ULL
#define WT_CONF_ID_Hash 329ULL
#define WT_CONF_ID_Heuristic_controls 265ULL
#define WT_CONF_ID_History_store 269ULL
#define WT_CONF_ID_Hash 330ULL
#define WT_CONF_ID_Heuristic_controls 266ULL
#define WT_CONF_ID_History_store 270ULL
#define WT_CONF_ID_Import 99ULL
#define WT_CONF_ID_Incremental 139ULL
#define WT_CONF_ID_Io_capacity 271ULL
#define WT_CONF_ID_Io_capacity 272ULL
#define WT_CONF_ID_Live_restore 64ULL
#define WT_CONF_ID_Log 40ULL
#define WT_CONF_ID_Lsm 105ULL
#define WT_CONF_ID_Merge_custom 115ULL
#define WT_CONF_ID_Operation_tracking 281ULL
#define WT_CONF_ID_Page_delta 283ULL
#define WT_CONF_ID_Prefetch 309ULL
#define WT_CONF_ID_Prefetch1 311ULL
#define WT_CONF_ID_Rollback_to_stable 289ULL
#define WT_CONF_ID_Operation_tracking 282ULL
#define WT_CONF_ID_Page_delta 284ULL
#define WT_CONF_ID_Prefetch 310ULL
#define WT_CONF_ID_Prefetch1 312ULL
#define WT_CONF_ID_Rollback_to_stable 290ULL
#define WT_CONF_ID_Roundup_timestamps 173ULL
#define WT_CONF_ID_Shared_cache 291ULL
#define WT_CONF_ID_Statistics_log 295ULL
#define WT_CONF_ID_Shared_cache 292ULL
#define WT_CONF_ID_Statistics_log 296ULL
#define WT_CONF_ID_Tiered_storage 51ULL
#define WT_CONF_ID_Transaction_sync 349ULL
#define WT_CONF_ID_Transaction_sync 350ULL
#define WT_CONF_ID_access_pattern_hint 12ULL
#define WT_CONF_ID_action 88ULL
#define WT_CONF_ID_allocation_size 13ULL
#define WT_CONF_ID_app_eviction_min_cache_fill_ratio 247ULL
#define WT_CONF_ID_app_eviction_min_cache_fill_ratio 248ULL
#define WT_CONF_ID_app_metadata 0ULL
#define WT_CONF_ID_append 85ULL
#define WT_CONF_ID_archive 275ULL
#define WT_CONF_ID_archive 276ULL
#define WT_CONF_ID_auth_token 52ULL
#define WT_CONF_ID_auto_throttle 106ULL
#define WT_CONF_ID_available 341ULL
#define WT_CONF_ID_available 342ULL
#define WT_CONF_ID_background 92ULL
#define WT_CONF_ID_background_compact 220ULL
#define WT_CONF_ID_backup 186ULL
#define WT_CONF_ID_backup_restore_target 312ULL
#define WT_CONF_ID_backup_restore_target 313ULL
#define WT_CONF_ID_bitmap 65ULL
#define WT_CONF_ID_blkcache_eviction_aggression 197ULL
#define WT_CONF_ID_block_allocation 14ULL
@ -76,12 +76,12 @@
#define WT_CONF_ID_bound 89ULL
#define WT_CONF_ID_bucket 53ULL
#define WT_CONF_ID_bucket_prefix 54ULL
#define WT_CONF_ID_buckets 330ULL
#define WT_CONF_ID_buffer_alignment 313ULL
#define WT_CONF_ID_builtin_extension_config 314ULL
#define WT_CONF_ID_buckets 331ULL
#define WT_CONF_ID_buffer_alignment 314ULL
#define WT_CONF_ID_builtin_extension_config 315ULL
#define WT_CONF_ID_bulk 127ULL
#define WT_CONF_ID_cache 187ULL
#define WT_CONF_ID_cache_cursors 305ULL
#define WT_CONF_ID_cache_cursors 306ULL
#define WT_CONF_ID_cache_directory 55ULL
#define WT_CONF_ID_cache_max_wait_ms 205ULL
#define WT_CONF_ID_cache_on_checkpoint 195ULL
@ -90,56 +90,57 @@
#define WT_CONF_ID_cache_resident 17ULL
#define WT_CONF_ID_cache_size 207ULL
#define WT_CONF_ID_cache_stuck_timeout_ms 208ULL
#define WT_CONF_ID_cache_tolerance_for_app_eviction 248ULL
#define WT_CONF_ID_capacity 316ULL
#define WT_CONF_ID_cache_tolerance_for_app_eviction 249ULL
#define WT_CONF_ID_capacity 317ULL
#define WT_CONF_ID_checkpoint 60ULL
#define WT_CONF_ID_checkpoint_backup_info 61ULL
#define WT_CONF_ID_checkpoint_cleanup 179ULL
#define WT_CONF_ID_checkpoint_cleanup_obsolete_tw_pages_dirty_max 266ULL
#define WT_CONF_ID_checkpoint_cleanup_obsolete_tw_pages_dirty_max 267ULL
#define WT_CONF_ID_checkpoint_crash_point 180ULL
#define WT_CONF_ID_checkpoint_fail_before_turtle_update 306ULL
#define WT_CONF_ID_checkpoint_fail_before_turtle_update 307ULL
#define WT_CONF_ID_checkpoint_lsn 62ULL
#define WT_CONF_ID_checkpoint_meta 74ULL
#define WT_CONF_ID_checkpoint_read_timestamp 130ULL
#define WT_CONF_ID_checkpoint_retention 222ULL
#define WT_CONF_ID_checkpoint_sync 315ULL
#define WT_CONF_ID_checkpoint_retention 223ULL
#define WT_CONF_ID_checkpoint_sync 316ULL
#define WT_CONF_ID_checkpoint_use_history 128ULL
#define WT_CONF_ID_checkpoint_wait 121ULL
#define WT_CONF_ID_checksum 18ULL
#define WT_CONF_ID_chunk 292ULL
#define WT_CONF_ID_chunk_cache 273ULL
#define WT_CONF_ID_chunk_cache_evict_trigger 317ULL
#define WT_CONF_ID_chunk 293ULL
#define WT_CONF_ID_chunk_cache 274ULL
#define WT_CONF_ID_chunk_cache_evict_trigger 318ULL
#define WT_CONF_ID_chunk_count_limit 112ULL
#define WT_CONF_ID_chunk_max 113ULL
#define WT_CONF_ID_chunk_size 114ULL
#define WT_CONF_ID_claim_prepared_id 167ULL
#define WT_CONF_ID_close_handle_minimum 261ULL
#define WT_CONF_ID_close_idle_time 262ULL
#define WT_CONF_ID_close_scan_interval 263ULL
#define WT_CONF_ID_close_handle_minimum 262ULL
#define WT_CONF_ID_close_idle_time 263ULL
#define WT_CONF_ID_close_scan_interval 264ULL
#define WT_CONF_ID_colgroups 81ULL
#define WT_CONF_ID_collator 6ULL
#define WT_CONF_ID_columns 7ULL
#define WT_CONF_ID_commit_timestamp 2ULL
#define WT_CONF_ID_compare_timestamp 100ULL
#define WT_CONF_ID_compile_configuration_count 322ULL
#define WT_CONF_ID_compressor 334ULL
#define WT_CONF_ID_config 301ULL
#define WT_CONF_ID_config_base 323ULL
#define WT_CONF_ID_configuration 223ULL
#define WT_CONF_ID_compile_configuration_count 323ULL
#define WT_CONF_ID_compressor 335ULL
#define WT_CONF_ID_config 302ULL
#define WT_CONF_ID_config_base 324ULL
#define WT_CONF_ID_configuration 224ULL
#define WT_CONF_ID_consolidate 140ULL
#define WT_CONF_ID_corruption_abort 221ULL
#define WT_CONF_ID_create 324ULL
#define WT_CONF_ID_corruption_abort 222ULL
#define WT_CONF_ID_crash_point_colgroup 221ULL
#define WT_CONF_ID_create 325ULL
#define WT_CONF_ID_cross_key 136ULL
#define WT_CONF_ID_cursor_copy 224ULL
#define WT_CONF_ID_cursor_reposition 225ULL
#define WT_CONF_ID_cursor_copy 225ULL
#define WT_CONF_ID_cursor_reposition 226ULL
#define WT_CONF_ID_cursors 188ULL
#define WT_CONF_ID_default 342ULL
#define WT_CONF_ID_delta_pct 284ULL
#define WT_CONF_ID_dhandle_buckets 331ULL
#define WT_CONF_ID_default 343ULL
#define WT_CONF_ID_delta_pct 285ULL
#define WT_CONF_ID_dhandle_buckets 332ULL
#define WT_CONF_ID_dictionary 19ULL
#define WT_CONF_ID_direct_io 325ULL
#define WT_CONF_ID_disagg_address_cookie_optional_field 227ULL
#define WT_CONF_ID_disagg_address_cookie_upgrade 226ULL
#define WT_CONF_ID_direct_io 326ULL
#define WT_CONF_ID_disagg_address_cookie_optional_field 228ULL
#define WT_CONF_ID_disagg_address_cookie_upgrade 227ULL
#define WT_CONF_ID_do_not_clear_txn_id 155ULL
#define WT_CONF_ID_drop 181ULL
#define WT_CONF_ID_dryrun 93ULL
@ -153,70 +154,70 @@
#define WT_CONF_ID_dump_pages 162ULL
#define WT_CONF_ID_dump_tree_shape 163ULL
#define WT_CONF_ID_durable_timestamp 3ULL
#define WT_CONF_ID_early_load 302ULL
#define WT_CONF_ID_early_load 303ULL
#define WT_CONF_ID_enabled 41ULL
#define WT_CONF_ID_entry 303ULL
#define WT_CONF_ID_error_prefix 240ULL
#define WT_CONF_ID_evict_sample_inmem 244ULL
#define WT_CONF_ID_evict_use_softptr 245ULL
#define WT_CONF_ID_eviction 228ULL
#define WT_CONF_ID_eviction_checkpoint_target 252ULL
#define WT_CONF_ID_eviction_checkpoint_ts_ordering 239ULL
#define WT_CONF_ID_eviction_dirty_target 253ULL
#define WT_CONF_ID_eviction_dirty_trigger 254ULL
#define WT_CONF_ID_eviction_obsolete_tw_pages_dirty_max 267ULL
#define WT_CONF_ID_eviction_target 255ULL
#define WT_CONF_ID_eviction_trigger 256ULL
#define WT_CONF_ID_eviction_updates_target 257ULL
#define WT_CONF_ID_eviction_updates_trigger 258ULL
#define WT_CONF_ID_entry 304ULL
#define WT_CONF_ID_error_prefix 241ULL
#define WT_CONF_ID_evict_sample_inmem 245ULL
#define WT_CONF_ID_evict_use_softptr 246ULL
#define WT_CONF_ID_eviction 229ULL
#define WT_CONF_ID_eviction_checkpoint_target 253ULL
#define WT_CONF_ID_eviction_checkpoint_ts_ordering 240ULL
#define WT_CONF_ID_eviction_dirty_target 254ULL
#define WT_CONF_ID_eviction_dirty_trigger 255ULL
#define WT_CONF_ID_eviction_obsolete_tw_pages_dirty_max 268ULL
#define WT_CONF_ID_eviction_target 256ULL
#define WT_CONF_ID_eviction_trigger 257ULL
#define WT_CONF_ID_eviction_updates_target 258ULL
#define WT_CONF_ID_eviction_updates_trigger 259ULL
#define WT_CONF_ID_exclude 94ULL
#define WT_CONF_ID_exclusive 98ULL
#define WT_CONF_ID_exclusive_refreshed 91ULL
#define WT_CONF_ID_extensions 327ULL
#define WT_CONF_ID_extra_diagnostics 259ULL
#define WT_CONF_ID_extensions 328ULL
#define WT_CONF_ID_extra_diagnostics 260ULL
#define WT_CONF_ID_extractor 70ULL
#define WT_CONF_ID_file 141ULL
#define WT_CONF_ID_file_extend 328ULL
#define WT_CONF_ID_file_max 270ULL
#define WT_CONF_ID_file_extend 329ULL
#define WT_CONF_ID_file_max 271ULL
#define WT_CONF_ID_file_metadata 101ULL
#define WT_CONF_ID_file_wait_ms 214ULL
#define WT_CONF_ID_final_flush 184ULL
#define WT_CONF_ID_flatten_leaf_page_delta 285ULL
#define WT_CONF_ID_flatten_leaf_page_delta 286ULL
#define WT_CONF_ID_flush_time 72ULL
#define WT_CONF_ID_flush_timestamp 73ULL
#define WT_CONF_ID_flushed_data_cache_insertion 319ULL
#define WT_CONF_ID_flushed_data_cache_insertion 320ULL
#define WT_CONF_ID_force 122ULL
#define WT_CONF_ID_force_stop 142ULL
#define WT_CONF_ID_force_write_wait 335ULL
#define WT_CONF_ID_force_write_wait 336ULL
#define WT_CONF_ID_format 25ULL
#define WT_CONF_ID_free_space_target 95ULL
#define WT_CONF_ID_full_target 198ULL
#define WT_CONF_ID_generation_drain_timeout_ms 264ULL
#define WT_CONF_ID_generation_drain_timeout_ms 265ULL
#define WT_CONF_ID_get 154ULL
#define WT_CONF_ID_granularity 143ULL
#define WT_CONF_ID_handles 189ULL
#define WT_CONF_ID_hashsize 200ULL
#define WT_CONF_ID_hazard_max 332ULL
#define WT_CONF_ID_hazard_max 333ULL
#define WT_CONF_ID_huffman_key 26ULL
#define WT_CONF_ID_huffman_value 27ULL
#define WT_CONF_ID_id 63ULL
#define WT_CONF_ID_ignore_cache_size 308ULL
#define WT_CONF_ID_ignore_cache_size 309ULL
#define WT_CONF_ID_ignore_in_memory_cache_size 28ULL
#define WT_CONF_ID_ignore_prepare 168ULL
#define WT_CONF_ID_immutable 71ULL
#define WT_CONF_ID_in_memory 29ULL
#define WT_CONF_ID_inclusive 90ULL
#define WT_CONF_ID_incremental_app_eviction 249ULL
#define WT_CONF_ID_incremental_app_eviction 250ULL
#define WT_CONF_ID_ingest 79ULL
#define WT_CONF_ID_internal_item_max 30ULL
#define WT_CONF_ID_internal_key_max 31ULL
#define WT_CONF_ID_internal_key_truncate 32ULL
#define WT_CONF_ID_internal_page_delta 286ULL
#define WT_CONF_ID_internal_page_delta 287ULL
#define WT_CONF_ID_internal_page_max 33ULL
#define WT_CONF_ID_interval 348ULL
#define WT_CONF_ID_interval 349ULL
#define WT_CONF_ID_isolation 169ULL
#define WT_CONF_ID_json 296ULL
#define WT_CONF_ID_json_output 274ULL
#define WT_CONF_ID_json 297ULL
#define WT_CONF_ID_json_output 275ULL
#define WT_CONF_ID_key_format 34ULL
#define WT_CONF_ID_key_gap 35ULL
#define WT_CONF_ID_keyid 24ULL
@ -224,19 +225,19 @@
#define WT_CONF_ID_last_materialized_lsn 75ULL
#define WT_CONF_ID_leaf_item_max 36ULL
#define WT_CONF_ID_leaf_key_max 37ULL
#define WT_CONF_ID_leaf_page_delta 287ULL
#define WT_CONF_ID_leaf_page_delta 288ULL
#define WT_CONF_ID_leaf_page_max 38ULL
#define WT_CONF_ID_leaf_value_max 39ULL
#define WT_CONF_ID_leak_memory 185ULL
#define WT_CONF_ID_legacy_page_visit_strategy 246ULL
#define WT_CONF_ID_legacy_page_visit_strategy 247ULL
#define WT_CONF_ID_local_files_action 76ULL
#define WT_CONF_ID_local_retention 56ULL
#define WT_CONF_ID_lock_wait 123ULL
#define WT_CONF_ID_log 190ULL
#define WT_CONF_ID_log_retention 229ULL
#define WT_CONF_ID_log_retention 230ULL
#define WT_CONF_ID_log_size 210ULL
#define WT_CONF_ID_lose_all_my_data 77ULL
#define WT_CONF_ID_max_consecutive_delta 288ULL
#define WT_CONF_ID_max_consecutive_delta 289ULL
#define WT_CONF_ID_max_percent_overhead 201ULL
#define WT_CONF_ID_memory_page_image_max 42ULL
#define WT_CONF_ID_memory_page_max 43ULL
@ -245,9 +246,9 @@
#define WT_CONF_ID_metadata 191ULL
#define WT_CONF_ID_metadata_file 102ULL
#define WT_CONF_ID_method 213ULL
#define WT_CONF_ID_mmap 337ULL
#define WT_CONF_ID_mmap_all 338ULL
#define WT_CONF_ID_multiprocess 339ULL
#define WT_CONF_ID_mmap 338ULL
#define WT_CONF_ID_mmap_all 339ULL
#define WT_CONF_ID_multiprocess 340ULL
#define WT_CONF_ID_name 23ULL
#define WT_CONF_ID_nbits 66ULL
#define WT_CONF_ID_next_random 146ULL
@ -256,25 +257,25 @@
#define WT_CONF_ID_no_timestamp 170ULL
#define WT_CONF_ID_nvram_path 202ULL
#define WT_CONF_ID_object_target_size 57ULL
#define WT_CONF_ID_obsolete_tw_btree_max 268ULL
#define WT_CONF_ID_obsolete_tw_btree_max 269ULL
#define WT_CONF_ID_oldest 83ULL
#define WT_CONF_ID_oldest_timestamp 310ULL
#define WT_CONF_ID_on_close 297ULL
#define WT_CONF_ID_oldest_timestamp 311ULL
#define WT_CONF_ID_on_close 298ULL
#define WT_CONF_ID_operation_timeout_ms 171ULL
#define WT_CONF_ID_os_cache_dirty_max 44ULL
#define WT_CONF_ID_os_cache_dirty_pct 276ULL
#define WT_CONF_ID_os_cache_dirty_pct 277ULL
#define WT_CONF_ID_os_cache_max 45ULL
#define WT_CONF_ID_overwrite 86ULL
#define WT_CONF_ID_page_history 230ULL
#define WT_CONF_ID_page_history 231ULL
#define WT_CONF_ID_page_log 21ULL
#define WT_CONF_ID_panic_corrupt 103ULL
#define WT_CONF_ID_path 282ULL
#define WT_CONF_ID_path 283ULL
#define WT_CONF_ID_percent_file_in_dram 203ULL
#define WT_CONF_ID_pinned 216ULL
#define WT_CONF_ID_prealloc 277ULL
#define WT_CONF_ID_prealloc_init_count 278ULL
#define WT_CONF_ID_precise_checkpoint 340ULL
#define WT_CONF_ID_prefer_scrub_eviction 250ULL
#define WT_CONF_ID_prealloc 278ULL
#define WT_CONF_ID_prealloc_init_count 279ULL
#define WT_CONF_ID_precise_checkpoint 341ULL
#define WT_CONF_ID_prefer_scrub_eviction 251ULL
#define WT_CONF_ID_prefix 116ULL
#define WT_CONF_ID_prefix_compression 46ULL
#define WT_CONF_ID_prefix_compression_min 47ULL
@ -282,47 +283,47 @@
#define WT_CONF_ID_prepare_timestamp 176ULL
#define WT_CONF_ID_prepared 174ULL
#define WT_CONF_ID_prepared_id 177ULL
#define WT_CONF_ID_preserve_prepared 343ULL
#define WT_CONF_ID_preserve_prepared 344ULL
#define WT_CONF_ID_priority 172ULL
#define WT_CONF_ID_quota 293ULL
#define WT_CONF_ID_quota 294ULL
#define WT_CONF_ID_raw 149ULL
#define WT_CONF_ID_raw_key_value 135ULL
#define WT_CONF_ID_read 175ULL
#define WT_CONF_ID_read_corrupt 164ULL
#define WT_CONF_ID_read_once 150ULL
#define WT_CONF_ID_read_size 333ULL
#define WT_CONF_ID_read_size 334ULL
#define WT_CONF_ID_read_timestamp 4ULL
#define WT_CONF_ID_readonly 67ULL
#define WT_CONF_ID_realloc_exact 231ULL
#define WT_CONF_ID_realloc_malloc 232ULL
#define WT_CONF_ID_recover 336ULL
#define WT_CONF_ID_realloc_exact 232ULL
#define WT_CONF_ID_realloc_malloc 233ULL
#define WT_CONF_ID_recover 337ULL
#define WT_CONF_ID_release 218ULL
#define WT_CONF_ID_release_evict 137ULL
#define WT_CONF_ID_release_evict_page 307ULL
#define WT_CONF_ID_remove 279ULL
#define WT_CONF_ID_release_evict_page 308ULL
#define WT_CONF_ID_remove 280ULL
#define WT_CONF_ID_remove_files 124ULL
#define WT_CONF_ID_remove_shared 125ULL
#define WT_CONF_ID_repair 104ULL
#define WT_CONF_ID_require_max 320ULL
#define WT_CONF_ID_require_min 321ULL
#define WT_CONF_ID_reserve 294ULL
#define WT_CONF_ID_require_max 321ULL
#define WT_CONF_ID_require_min 322ULL
#define WT_CONF_ID_reserve 295ULL
#define WT_CONF_ID_role 78ULL
#define WT_CONF_ID_rollback_error 233ULL
#define WT_CONF_ID_rollback_error 234ULL
#define WT_CONF_ID_rollback_timestamp 178ULL
#define WT_CONF_ID_run_once 96ULL
#define WT_CONF_ID_salvage 344ULL
#define WT_CONF_ID_secretkey 326ULL
#define WT_CONF_ID_session_max 345ULL
#define WT_CONF_ID_session_scratch_max 346ULL
#define WT_CONF_ID_session_table_cache 347ULL
#define WT_CONF_ID_salvage 345ULL
#define WT_CONF_ID_secretkey 327ULL
#define WT_CONF_ID_session_max 346ULL
#define WT_CONF_ID_session_scratch_max 347ULL
#define WT_CONF_ID_session_table_cache 348ULL
#define WT_CONF_ID_sessions 192ULL
#define WT_CONF_ID_shared 58ULL
#define WT_CONF_ID_size 199ULL
#define WT_CONF_ID_skip_sort_check 151ULL
#define WT_CONF_ID_skip_update_obsolete_check 251ULL
#define WT_CONF_ID_slow_checkpoint 234ULL
#define WT_CONF_ID_skip_update_obsolete_check 252ULL
#define WT_CONF_ID_slow_checkpoint 235ULL
#define WT_CONF_ID_source 8ULL
#define WT_CONF_ID_sources 298ULL
#define WT_CONF_ID_sources 299ULL
#define WT_CONF_ID_split_deepen_min_child 48ULL
#define WT_CONF_ID_split_deepen_per_child 49ULL
#define WT_CONF_ID_split_pct 50ULL
@ -332,45 +333,45 @@
#define WT_CONF_ID_start_generation 117ULL
#define WT_CONF_ID_start_timestamp 133ULL
#define WT_CONF_ID_statistics 152ULL
#define WT_CONF_ID_storage_path 318ULL
#define WT_CONF_ID_stress_skiplist 235ULL
#define WT_CONF_ID_storage_path 319ULL
#define WT_CONF_ID_stress_skiplist 236ULL
#define WT_CONF_ID_strict 166ULL
#define WT_CONF_ID_suffix 118ULL
#define WT_CONF_ID_sync 126ULL
#define WT_CONF_ID_system_ram 204ULL
#define WT_CONF_ID_table_logging 236ULL
#define WT_CONF_ID_table_logging 237ULL
#define WT_CONF_ID_target 153ULL
#define WT_CONF_ID_terminate 304ULL
#define WT_CONF_ID_terminate 305ULL
#define WT_CONF_ID_this_id 145ULL
#define WT_CONF_ID_threads 290ULL
#define WT_CONF_ID_threads_max 242ULL
#define WT_CONF_ID_threads_min 243ULL
#define WT_CONF_ID_tiered_flush_error_continue 237ULL
#define WT_CONF_ID_threads 291ULL
#define WT_CONF_ID_threads_max 243ULL
#define WT_CONF_ID_threads_min 244ULL
#define WT_CONF_ID_tiered_flush_error_continue 238ULL
#define WT_CONF_ID_tiered_object 68ULL
#define WT_CONF_ID_tiers 84ULL
#define WT_CONF_ID_timeout 97ULL
#define WT_CONF_ID_timestamp 299ULL
#define WT_CONF_ID_timestamp 300ULL
#define WT_CONF_ID_timestamp_order 134ULL
#define WT_CONF_ID_timing_stress_for_test 300ULL
#define WT_CONF_ID_total 272ULL
#define WT_CONF_ID_timing_stress_for_test 301ULL
#define WT_CONF_ID_total 273ULL
#define WT_CONF_ID_txn 193ULL
#define WT_CONF_ID_type 9ULL
#define WT_CONF_ID_update_restore_evict 238ULL
#define WT_CONF_ID_use_environment 350ULL
#define WT_CONF_ID_use_environment_priv 351ULL
#define WT_CONF_ID_update_restore_evict 239ULL
#define WT_CONF_ID_use_environment 351ULL
#define WT_CONF_ID_use_environment_priv 352ULL
#define WT_CONF_ID_use_timestamp 183ULL
#define WT_CONF_ID_value_format 59ULL
#define WT_CONF_ID_verbose 10ULL
#define WT_CONF_ID_verify_metadata 352ULL
#define WT_CONF_ID_verify_metadata 353ULL
#define WT_CONF_ID_version 69ULL
#define WT_CONF_ID_visible_only 132ULL
#define WT_CONF_ID_wait 211ULL
#define WT_CONF_ID_write_through 353ULL
#define WT_CONF_ID_write_through 354ULL
#define WT_CONF_ID_write_timestamp 5ULL
#define WT_CONF_ID_write_timestamp_usage 11ULL
#define WT_CONF_ID_zero_fill 280ULL
#define WT_CONF_ID_zero_fill 281ULL
#define WT_CONF_ID_COUNT 354
#define WT_CONF_ID_COUNT 355
/*
* API configuration keys: END
*/
@ -437,6 +438,7 @@ static const struct {
uint64_t checkpoint_retention;
uint64_t configuration;
uint64_t corruption_abort;
uint64_t crash_point_colgroup;
uint64_t cursor_copy;
uint64_t cursor_reposition;
uint64_t disagg_address_cookie_optional_field;
@ -847,6 +849,7 @@ static const struct {
WT_CONF_ID_Debug_mode | (WT_CONF_ID_checkpoint_retention << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_configuration << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_corruption_abort << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_crash_point_colgroup << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_cursor_copy << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_cursor_reposition << 16),
WT_CONF_ID_Debug_mode | (WT_CONF_ID_disagg_address_cookie_optional_field << 16),

View File

@ -889,17 +889,18 @@ struct __wt_connection_impl {
#define WT_CONN_DEBUG_CKPT_RETAIN 0x0001u
#define WT_CONN_DEBUG_CONFIGURATION 0x0002u
#define WT_CONN_DEBUG_CORRUPTION_ABORT 0x0004u
#define WT_CONN_DEBUG_CURSOR_COPY 0x0008u
#define WT_CONN_DEBUG_CURSOR_REPOSITION 0x0010u
#define WT_CONN_DEBUG_EVICTION_CKPT_TS_ORDERING 0x0020u
#define WT_CONN_DEBUG_EVICT_AGGRESSIVE_MODE 0x0040u
#define WT_CONN_DEBUG_REALLOC_EXACT 0x0080u
#define WT_CONN_DEBUG_REALLOC_MALLOC 0x0100u
#define WT_CONN_DEBUG_SLOW_CKPT 0x0200u
#define WT_CONN_DEBUG_STRESS_SKIPLIST 0x0400u
#define WT_CONN_DEBUG_TABLE_LOGGING 0x0800u
#define WT_CONN_DEBUG_TIERED_FLUSH_ERROR_CONTINUE 0x1000u
#define WT_CONN_DEBUG_UPDATE_RESTORE_EVICT 0x2000u
#define WT_CONN_DEBUG_CRASH_POINT_COLGROUP 0x0008u
#define WT_CONN_DEBUG_CURSOR_COPY 0x0010u
#define WT_CONN_DEBUG_CURSOR_REPOSITION 0x0020u
#define WT_CONN_DEBUG_EVICTION_CKPT_TS_ORDERING 0x0040u
#define WT_CONN_DEBUG_EVICT_AGGRESSIVE_MODE 0x0080u
#define WT_CONN_DEBUG_REALLOC_EXACT 0x0100u
#define WT_CONN_DEBUG_REALLOC_MALLOC 0x0200u
#define WT_CONN_DEBUG_SLOW_CKPT 0x0400u
#define WT_CONN_DEBUG_STRESS_SKIPLIST 0x0800u
#define WT_CONN_DEBUG_TABLE_LOGGING 0x1000u
#define WT_CONN_DEBUG_TIERED_FLUSH_ERROR_CONTINUE 0x2000u
#define WT_CONN_DEBUG_UPDATE_RESTORE_EVICT 0x4000u
/* AUTOMATIC FLAG VALUE GENERATION STOP 16 */
uint16_t debug_flags;

View File

@ -691,6 +691,8 @@ extern int __wt_import_repair(WT_SESSION_IMPL *session, const char *uri, char **
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_inmem_unsupported_op(WT_SESSION_IMPL *session, const char *tag)
WT_GCC_FUNC_DECL_ATTRIBUTE((cold)) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_is_simple_table(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *colconf, bool *is_simplep)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));
extern int __wt_json_alloc_unpack(WT_SESSION_IMPL *session, const void *buffer, size_t size,
const char *fmt, WT_JSON *json, bool iskey, va_list ap)
WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result));

View File

@ -430,8 +430,12 @@ struct __wt_connection_stats {
int64_t background_compact_ema;
int64_t background_compact_bytes_recovered;
int64_t background_compact_running;
int64_t background_compact_exclude;
int64_t background_compact_skipped_exclude;
int64_t background_compact_skipped_small_file;
int64_t background_compact_skipped;
int64_t background_compact_skipped_unsuccessful;
int64_t background_compact_skipped_no_such_file;
int64_t background_compact_skipped_missing_permissions;
int64_t background_compact_sleep_cache_pressure;
int64_t background_compact_success;
int64_t background_compact_timeout;

File diff suppressed because it is too large Load Diff

View File

@ -630,6 +630,15 @@ __create_colgroup(WT_SESSION_IMPL *session, const char *name, bool exclusive, co
WT_ERR(__wt_config_collapse(session, cfg, &cgconf));
/* FIXME-WT-12021 Replace this with a proper failpoint once the framework is available. */
if (FLD_ISSET(S2C(session)->debug_flags, WT_CONN_DEBUG_CRASH_POINT_COLGROUP)) {
__wt_verbose_warning(session, WT_VERB_DEFAULT,
"Simulating a crash before inserting column group metadata entry '%s'", name);
/* Wait for the file metadata entry to be persisted. */
__wt_sleep(2, 0);
__wt_abort(session);
}
if (!exists) {
WT_ERR(__wt_metadata_insert(session, name, cgconf));
WT_ERR(__wti_schema_open_colgroups(session, table));

View File

@ -176,6 +176,7 @@ __drop_table(
WT_SESSION_IMPL *session, const char *uri, bool force, const char *cfg[], bool check_visibility)
{
WT_COLGROUP *colgroup;
WT_DECL_ITEM(file_uri_buf);
WT_DECL_RET;
WT_INDEX *idx;
WT_TABLE *table;
@ -186,10 +187,11 @@ __drop_table(
WT_ASSERT(session, FLD_ISSET(session->lock_flags, WT_SESSION_LOCKED_TABLE_WRITE));
name = uri;
WT_PREFIX_SKIP_REQUIRED(session, name, "table:");
table = NULL;
tracked = false;
WT_ERR(__wt_scr_alloc(session, 0, &file_uri_buf));
WT_PREFIX_SKIP_REQUIRED(session, name, "table:");
/*
* Open the table so we can drop its column groups and indexes.
@ -214,6 +216,17 @@ __drop_table(
WT_ERR(ENOTSUP);
}
WT_ERR(__wt_buf_fmt(session, file_uri_buf, "file:%s.wt", name));
/*
* In a crash, it is possible for the file metadata entry to exist even though the colgroup was
* not created completely. In such a scenario, drop the file to keep the metadata consistent.
*
* FIXME-WT-16146: Add capability for cleaning up incomplete complex and tiered tables.
*/
if (!table->cg_complete && table->is_simple)
WT_ERR(__wt_schema_drop(session, file_uri_buf->data, cfg, check_visibility));
/* Drop the column groups. */
for (i = 0; i < WT_COLGROUPS(table); i++) {
if ((colgroup = table->cgroups[i]) == NULL)
@ -253,6 +266,7 @@ __drop_table(
WT_ERR(__wt_metadata_remove(session, uri));
err:
__wt_scr_free(session, &file_uri_buf);
if (!tracked)
WT_TRET(__wt_schema_release_table(session, &table));
return (ret);
@ -462,11 +476,13 @@ __schema_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], bool
if (ret == WT_NOTFOUND || ret == ENOENT)
ret = force ? 0 : ENOENT;
if (F_ISSET(S2C(session), WT_CONN_BACKUP_PARTIAL_RESTORE))
WT_TRET(__wt_meta_track_off(session, false, ret != 0));
else
WT_TRET(__wt_meta_track_off(session, true, ret != 0));
/*
* FIXME-WT-16215: During recovery (including partial backup restore), the meta tracking has not
* been initialized yet. We don't need to use meta tracking as recovery must end with a
* checkpoint to syncs all files.
*/
bool need_sync = !F_ISSET(S2C(session), WT_CONN_BACKUP_PARTIAL_RESTORE | WT_CONN_RECOVERING);
WT_TRET(__wt_meta_track_off(session, need_sync, ret != 0));
return (ret);
}

View File

@ -469,14 +469,7 @@ __schema_open_table(WT_SESSION_IMPL *session)
/* Point to some items in the copy to save re-parsing. */
WT_RET(__wt_config_gets(session, table_cfg, "columns", &table->colconf));
/*
* Count the number of columns: tables are "simple" if the columns are not named.
*/
__wt_config_subinit(session, &cparser, &table->colconf);
table->is_simple = true;
while ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0)
table->is_simple = false;
WT_RET_NOTFOUND_OK(ret);
WT_RET(__wt_is_simple_table(session, &table->colconf, &table->is_simple));
/* Check that the columns match the key and value formats. */
if (!table->is_simple)

View File

@ -185,3 +185,26 @@ err:
__wt_scr_free(session, &tmp);
return (ret);
}
/*
* __wt_is_simple_table --
* Check whether the given table is simple.
*/
int
__wt_is_simple_table(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *colconf, bool *is_simplep)
{
WT_CONFIG cparser;
WT_CONFIG_ITEM ckey, cval;
WT_DECL_RET;
__wt_config_subinit(session, &cparser, colconf);
*is_simplep = true;
/* Count the number of columns: tables are "simple" if the columns are not named. */
while ((ret = __wt_config_next(&cparser, &ckey, &cval)) == 0) {
*is_simplep = false;
break;
}
WT_RET_NOTFOUND_OK(ret);
return (0);
}

View File

@ -1768,8 +1768,13 @@ static const char *const __stats_connection_desc[] = {
"background-compact: background compact moving average of bytes rewritten",
"background-compact: background compact recovered bytes",
"background-compact: background compact running",
"background-compact: background compact skipped file as it is part of the exclude list",
"background-compact: background compact skipped file as not meeting requirements for compaction",
"background-compact: background compact skipped file, it is part of the exclude list",
"background-compact: background compact skipped file, it is smaller than 1MB in size",
"background-compact: background compact skipped file, not meeting requirements for compaction",
"background-compact: background compact skipped, last compact was unsuccessful/less successful "
"than average",
"background-compact: background compact skipped, no such file exists",
"background-compact: background compact skipped, there is a permissions issue",
"background-compact: background compact sleeps due to cache pressure",
"background-compact: background compact successful calls",
"background-compact: background compact timeout",
@ -2818,8 +2823,12 @@ __wt_stat_connection_clear_single(WT_CONNECTION_STATS *stats)
stats->background_compact_ema = 0;
stats->background_compact_bytes_recovered = 0;
stats->background_compact_running = 0;
stats->background_compact_exclude = 0;
stats->background_compact_skipped_exclude = 0;
stats->background_compact_skipped_small_file = 0;
stats->background_compact_skipped = 0;
stats->background_compact_skipped_unsuccessful = 0;
stats->background_compact_skipped_no_such_file = 0;
stats->background_compact_skipped_missing_permissions = 0;
stats->background_compact_sleep_cache_pressure = 0;
stats->background_compact_success = 0;
stats->background_compact_timeout = 0;
@ -3796,8 +3805,17 @@ __wt_stat_connection_aggregate(WT_CONNECTION_STATS **from, WT_CONNECTION_STATS *
to->background_compact_bytes_recovered +=
WT_STAT_CONN_READ(from, background_compact_bytes_recovered);
to->background_compact_running += WT_STAT_CONN_READ(from, background_compact_running);
to->background_compact_exclude += WT_STAT_CONN_READ(from, background_compact_exclude);
to->background_compact_skipped_exclude +=
WT_STAT_CONN_READ(from, background_compact_skipped_exclude);
to->background_compact_skipped_small_file +=
WT_STAT_CONN_READ(from, background_compact_skipped_small_file);
to->background_compact_skipped += WT_STAT_CONN_READ(from, background_compact_skipped);
to->background_compact_skipped_unsuccessful +=
WT_STAT_CONN_READ(from, background_compact_skipped_unsuccessful);
to->background_compact_skipped_no_such_file +=
WT_STAT_CONN_READ(from, background_compact_skipped_no_such_file);
to->background_compact_skipped_missing_permissions +=
WT_STAT_CONN_READ(from, background_compact_skipped_missing_permissions);
to->background_compact_sleep_cache_pressure +=
WT_STAT_CONN_READ(from, background_compact_sleep_cache_pressure);
to->background_compact_success += WT_STAT_CONN_READ(from, background_compact_success);

View File

@ -799,12 +799,13 @@ __recovery_close_cursors(WT_RECOVERY *r)
}
/*
* __recovery_file_scan_prefix --
* Scan the files matching the prefix referenced from the metadata and gather information about
* them for recovery.
* __recovery_metadata_scan_prefix --
* Scan the files matching the prefix referenced from the metadata and call the worker function
* for each entry.
*/
static int
__recovery_file_scan_prefix(WT_RECOVERY *r, const char *prefix, const char *ignore_suffix)
__recovery_metadata_scan_prefix(WT_RECOVERY *r, const char *prefix, const char *ignore_suffix,
int (*recovery_meta_worker_func)(WT_RECOVERY *, const char *, const char *))
{
WT_CURSOR *c;
WT_DECL_RET;
@ -831,25 +832,87 @@ __recovery_file_scan_prefix(WT_RECOVERY *r, const char *prefix, const char *igno
if (ignore_suffix != NULL && WT_SUFFIX_MATCH(uri, ignore_suffix))
continue;
WT_RET(c->get_value(c, &config));
WT_RET(__recovery_setup_file(r, uri, config));
WT_RET(recovery_meta_worker_func(r, uri, config));
}
WT_RET_NOTFOUND_OK(ret);
return (0);
}
/*
* __metadata_clean_incomplete_table --
* For each table metadata entry, check that the table was fully created. If not, clean up the
* incomplete table.
*/
static int
__metadata_clean_incomplete_table(WT_RECOVERY *r, const char *uri, const char *config)
{
WT_DECL_RET;
char *cg_meta_value;
const char *drop_cfg[] = {WT_CONFIG_BASE(r->session, WT_SESSION_drop), "force=true", NULL};
const char *metadata_cfg[] = {config, NULL};
const char *name;
WT_CONFIG_ITEM cval;
WT_ITEM *colgroup;
cg_meta_value = NULL;
WT_ERR(__wt_scr_alloc(r->session, 0, &colgroup));
/*
* FIXME-WT-16146: Add capability for cleaning up incomplete complex tables and skip checking
* tiered shared tables.
*/
bool is_simple;
WT_ERR(__wt_config_gets(r->session, metadata_cfg, "columns", &cval));
WT_ERR(__wt_is_simple_table(r->session, &cval, &is_simple));
if (!is_simple || ((ret = __wt_config_gets(r->session, metadata_cfg, "shared", &cval)) == 0))
goto done;
WT_ERR_NOTFOUND_OK(ret, false);
/* Check whether the colgroup exists. */
name = uri;
WT_PREFIX_SKIP_REQUIRED(r->session, name, "table:");
WT_ERR(__wt_buf_fmt(r->session, colgroup, "colgroup:%s", name));
WT_ERR_NOTFOUND_OK(__wt_metadata_search(r->session, colgroup->data, &cg_meta_value), true);
if (ret == 0)
goto done;
__wt_verbose_level_multi(r->session, WT_VERB_RECOVERY_ALL, WT_VERBOSE_WARNING, "%s %s",
"removing incomplete table", uri);
WT_WITH_SCHEMA_LOCK(r->session,
WT_WITH_TABLE_WRITE_LOCK(
r->session, ret = __wt_schema_drop(r->session, uri, drop_cfg, false)));
WT_ERR(ret);
err:
done:
__wt_free(r->session, cg_meta_value);
__wt_scr_free(r->session, &colgroup);
return (ret);
}
/*
* __recovery_file_scan --
* Scan the files referenced from the metadata and gather information about them for recovery.
* Scan the files referenced from the metadata to clean up incomplete tables and gather
* information about them for recovery.
*/
static int
__recovery_file_scan(WT_RECOVERY *r)
{
__wt_verbose_level_multi(r->session, WT_VERB_RECOVERY_ALL, WT_VERBOSE_INFO, "%s",
"scanning metadata to remove all incomplete tables");
/* Scan through all table entries in the metadata and clean up incomplete tables. */
__recovery_metadata_scan_prefix(r, "table:", NULL, __metadata_clean_incomplete_table);
__wt_verbose_level_multi(r->session, WT_VERB_RECOVERY_ALL, WT_VERBOSE_INFO, "%s",
"scanning metadata to find the largest file ID");
/* Scan through all files and tiered entries in the metadata. */
WT_RET(__recovery_file_scan_prefix(r, "file:", ".wtobj"));
WT_RET(__recovery_file_scan_prefix(r, "tiered:", NULL));
/*
* Scan through all files and tiered entries in the metadata and gather information about each
* entry for recovery.
*/
WT_RET(__recovery_metadata_scan_prefix(r, "file:", ".wtobj", __recovery_setup_file));
WT_RET(__recovery_metadata_scan_prefix(r, "tiered:", NULL, __recovery_setup_file));
/*
* Set the connection level file id tracker, as such upon creation of a new file we'll begin
@ -1079,7 +1142,8 @@ __wt_txn_recover(WT_SESSION_IMPL *session, const char *cfg[], bool disagg)
r.backup_only = false;
WT_ERR(ret);
/* Scan the metadata to find the live files and their IDs. */
/* Scan the metadata to find the live files and their IDs, and clean up any incomplete tables.
*/
WT_ERR(__recovery_file_scan(&r));
/*

View File

@ -57,7 +57,7 @@ def find_build_dir():
env_builddir = os.getenv('WT_BUILDDIR')
curdir = os.getcwd()
if env_builddir and os.path.isfile(os.path.join(env_builddir, 'wt')):
if env_builddir and is_build_dir(env_builddir):
wt_builddir = env_builddir
elif is_build_dir(curdir):
wt_builddir = curdir

View File

@ -184,7 +184,7 @@ class suite_subprocess:
# Run a method as a subprocess using the run.py machinery.
# Return the process exit status and the WiredTiger home
# directory used by the subprocess.
def run_subprocess_function(self, directory, funcname):
def run_subprocess_function(self, directory, funcname, silent=False):
testparts = funcname.split('.')
if len(testparts) != 3:
raise ValueError('bad function name "' + funcname +
@ -211,7 +211,7 @@ class suite_subprocess:
with open("subprocess.out", "w") as wtout:
returncode = subprocess.call(
procargs, stdout=wtout, stderr=wterr)
if returncode != 0:
if returncode != 0 and not silent:
# This is not necessarily an error, the primary reason to
# run in a subprocess is that it may crash.
self.show_outputs(procargs,

View File

@ -47,7 +47,7 @@ class test_compact09(compact_util):
def get_bg_compaction_files_excluded(self):
stat_cursor = self.session.open_cursor('statistics:', None, None)
files = stat_cursor[stat.conn.background_compact_exclude][2]
files = stat_cursor[stat.conn.background_compact_skipped_exclude][2]
stat_cursor.close()
return files

View File

@ -69,6 +69,7 @@ class test_metadata_cursor02(wttest.WiredTigerTestCase):
# Invalidate the table by dropping part of it
if self.drop == 'colgroup':
self.session.drop('colgroup:' + name[-2:])
self.ignoreStdoutPatternIfExists('removing incomplete table')
else:
self.session.drop('file:' + name[-2:] + '.wt')

View File

@ -71,6 +71,8 @@ class test_ovfl01(wttest.WiredTigerTestCase):
raise e
def test_ovfl01(self):
# FIXME-WT-15849: Need to fix bulk insert with overflow keys and page splits.
self.skipTest("Bulk insert with overflow keys and page splits needs fixing")
# Create and populate a table.
self.session.create(self.uri, self.table_config)
self.populate(self.uri)

View File

@ -0,0 +1,85 @@
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wttest, wiredtiger
from suite_subprocess import suite_subprocess
# test_schema09.py
# Test that incomplete tables are properly cleaned up during recovery.
@wttest.skip_for_hook("tiered", "test depends on metadata recovery")
class test_schema09(wttest.WiredTigerTestCase, suite_subprocess):
conn_config = 'log=(enabled=true)'
basename = 'test_schema09_fail'
tablename = 'table:' + basename
def create_table(self):
self.pr('create table')
self.session.create(self.tablename, 'key_format=5s,value_format=HQ,exclusive=true')
def subprocess_func(self):
self.conn.reconfigure("debug_mode=(crash_point_colgroup=true)")
self.create_table() # Expected to fail
def check_metadata_entry(self, exists):
expect_search = 0 if exists else wiredtiger.WT_NOTFOUND
meta_cursor = self.session.open_cursor('metadata:')
meta_cursor.set_key("file:" + self.basename + ".wt")
self.assertEqual(meta_cursor.search(), expect_search)
meta_cursor.set_key("table:" + self.basename)
self.assertEqual(meta_cursor.search(), expect_search)
meta_cursor.set_key("colgroup:" + self.basename)
self.assertEqual(meta_cursor.search(), expect_search)
meta_cursor.close()
def test_schema(self):
self.close_conn()
subdir = 'SUBPROCESS'
[ignore_result, new_home_dir] = self.run_subprocess_function(subdir,
'test_schema09.test_schema09.subprocess_func', silent=True)
with self.expectedStdoutPattern('removing incomplete table'):
self.conn = self.setUpConnectionOpen(new_home_dir)
self.session = self.setUpSessionOpen(self.conn)
self.conn.reconfigure("debug_mode=(crash_point_colgroup=false)")
self.check_metadata_entry(False)
# Test that we can't open a cursor on the table.
self.assertRaises(
wiredtiger.WiredTigerError, lambda: self.session.open_cursor(self.tablename, None))
# Test that we can't drop the table.
self.assertRaises(
wiredtiger.WiredTigerError, lambda: self.session.drop(self.tablename, None))
# Test that we can create the table.
self.create_table()
self.check_metadata_entry(True)