From 94b923a9900f81e750e3d69dc9e27ae573fd16e6 Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Tue, 11 May 2021 09:45:01 +1000 Subject: Import wiredtiger: aadac222429faa9b20d9344e3648a19be97811b9 from branch mongodb-4.4 ref: 03c93998a7..aadac22242 for: 4.4.7 WT-6204 Possible race between backup and checkpoint at file close WT-6362 Ensure that history store operations in user session context are correct WT-6387 Remove unused WT_CURSTD_UPDATE_LOCAL flag WT-6538 Fix onpage prepare visibility check if the start and stop are from the same prepared transaction WT-6893 Disable huffman config in compatibility test WT-6956 Cut WiredTiger 10.0.0 release WT-7076 Data placement for tiered storage in WiredTiger WT-7092 Reduce calls to hash URI when opening/closing cached cursors by one WT-7105 Add recovery error messages to include the URI WT-7133 Fix bug in stat collection when target pages are reduced due to high HS cache pressure WT-7173 Devise object naming scheme for tiered storage WT-7176 Adding Ubuntu 18.04 ASAN variant to wiredtiger build WT-7185 Avoid aborting a transaction if it is force evicting and oldest WT-7186 Correct expected in-memory abort updates in prepare scenario WT-7190 Limit eviction of non-history store pages when checkpoint is operating on history store WT-7191 Replace FNV hash with City hash WT-7229 Align out of order and mixed mode handling WT-7230 CMake build system support for x86 POSIX targets WT-7241 Add asserts to verify if prepared transaction abort mechanism is working as expected WT-7253 Add import functionality to test/format WT-7264 Creating a new configuration for search near that allows it to exit quickly when searching for prefixes WT-7266 Test to validate re-reading files that were closed with active history WT-7281 Add metric to record total sessions scanned WT-7282 Make backup debugging messages into verbose messages WT-7297 Fix search_near assertion WT-7312 Keys/Values updated to String type and save the created keys WT-7315 Implementation of the update thread operation in the test framework WT-7316 Adding operation throttles, and modifying component functionality to separate core loop WT-7329 Add hook capability to Python testing WT-7332 Add ability to cycle through create and drop tables in workgen WT-7345 Update incorrect copyright notices format WT-7346 Connect new API changes to local storage extension WT-7355 Create python hooks to validate tiered cursor implementation WT-7356 Implement bulk load for tiered tables WT-7365 Change the configuration file format WT-7367 Do not remove unstable updates of an in-memory database btree page WT-7368 Add WT_STORAGE_SOURCE.customize_file_system in place of locations WT-7374 Add missing branch checking logic for doc-update task WT-7376 Initialize tiered cursor name WT-7380 Fix wiredtiger connection string to clear statistics WT-7384 Fix an assert fire when inserting to the history store WT-7385 Remove 'auth_token' from being reconfigurable WT-7387 Replace cluster/member with hostid WT-7388 Add parens to assignment in conditional WT-7389 Remove on positioned tiered cursor should leave cursor positioned WT-7390 Add --noremove flag to Python test runner WT-7394 Coverity analysis defect 118020: Uninitialized scalar variable WT-7395 Coverity analysis defect 118042: Dereference after null check WT-7400 Set WT_HS_READ_ALL flag for the search before fixing the out of order timestamps WT-7403 Random cursor on empty tiered table loops forever WT-7409 Remove dead code WT-7410 Split session flags into two to accommodate more session flags in future WT-7413 Add an option to wtperf to run a backup operation WT-7414 Create a python test to ensure that all tables that are dropped during backup are exists in the backup WT-7415 Add new configuration files with backup option WT-7419 Tiered local storage changes to use WT file system WT-7420 Tiered local storage changed to flush files to bucket directory WT-7423 Clear checkpoint LSN and backup metadata on import WT-7425 Fix for the -C command line option WT-7428 Move bucket storage to tiered structure WT-7429 Set readonly metadata when switching tiered objects WT-7447 Fix the assert fire because onpage out of order update is not popped from the stack WT-7453 Coverity analysis defect 119968: Continue has no effect WT-7454 Coverity analysis defect 119967: Continue has no effect WT-7455 Coverity analysis defect 119966: Redundant test WT-7456 Coverity analysis defect 119965: Uninitialized pointer read WT-7457 Coverity: fix error in local store rename WT-7458 Coverity analysis defect 119949: Redundant test WT-7459 Coverity analysis defect 119947: Redundant test WT-7463 Use wt_off_t to avoid incompatible pointer types WT-7468 Fix tiered file and object metadata configuration WT-7474 Reset cursor-order checks whenever a search is performed WT-7475 Update format to use the new history-store cursor type WT-7476 Update configuration handling to allow for optional configuration settings WT-7477 Fix coverity bug: possible NULL dereference WT-7478 Fix coverity printf arg type to match format WT-7481 Fix the wrong assert of disk image write gen comparison with btree base write gen WT-7484 Coverity analysis defect 120014: Uninitialized scalar variable WT-7485 Coverity analysis defect 120018: Resource leak WT-7488 Coverity analysis defect 120015: Dereference after null check WT-7489 Avoid running RTS concurrently with checkpoint WT-7496 Add operations each tier can support to data structure WT-7500 Refactor tiered thread start code --- src/third_party/wiredtiger/src/block/block_ckpt.c | 42 ++++------------------- 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'src/third_party/wiredtiger/src/block/block_ckpt.c') diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c index 176d6570ff3..0f4af019b52 100644 --- a/src/third_party/wiredtiger/src/block/block_ckpt.c +++ b/src/third_party/wiredtiger/src/block/block_ckpt.c @@ -98,10 +98,7 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint block, &endp, ci->root_logid, ci->root_offset, ci->root_size, ci->root_checksum)); *root_addr_sizep = WT_PTRDIFF(endp, root_addr); - if (block->log_structured) { - block->logid = ci->root_logid; - WT_ERR(__wt_block_newfile(session, block)); - } + WT_ERR(__wt_block_tiered_load(session, block, ci)); } /* @@ -467,37 +464,6 @@ __ckpt_add_blk_mods_ext(WT_SESSION_IMPL *session, WT_CKPT *ckptbase, WT_BLOCK_CK return (0); } -/* - * __wt_block_newfile -- - * Switch a log-structured block object to a new file. - */ -int -__wt_block_newfile(WT_SESSION_IMPL *session, WT_BLOCK *block) -{ - WT_DECL_ITEM(tmp); - WT_DECL_RET; - const char *filename; - - /* Bump to a new file ID. */ - ++block->logid; - - WT_ERR(__wt_scr_alloc(session, 0, &tmp)); - WT_ERR(__wt_buf_fmt(session, tmp, "%s.%08" PRIu32, block->name, block->logid)); - filename = tmp->data; - WT_ERR(__wt_close(session, &block->fh)); - WT_ERR(__wt_open(session, filename, WT_FS_OPEN_FILE_TYPE_DATA, - WT_FS_OPEN_CREATE | block->file_flags, &block->fh)); - WT_ERR(__wt_desc_write(session, block->fh, block->allocsize)); - - block->size = block->allocsize; - __wt_block_ckpt_destroy(session, &block->live); - WT_ERR(__wt_block_ckpt_init(session, &block->live, "live")); - -err: - __wt_scr_free(session, &tmp); - return (ret); -} - /* * __ckpt_process -- * Process the list of checkpoints. @@ -780,8 +746,12 @@ live_update: ci->ckpt_discard = ci->discard; WT_ERR(__wt_block_extlist_init(session, &ci->discard, "live", "discard", false)); + /* + * TODO: tiered: for now we are switching files on a checkpoint, we'll want to do it only on + * flush_tier. + */ if (block->log_structured) - WT_ERR(__wt_block_newfile(session, block)); + WT_ERR(__wt_block_tiered_newfile(session, block)); #ifdef HAVE_DIAGNOSTIC /* -- cgit v1.2.1