diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-02-15 08:33:18 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-14 22:27:59 +0000 |
commit | c05b9d22da8e01fe7e9fce8ae25da25e95fd448c (patch) | |
tree | 314920dedc6edc13a7c2c47209d3ddaa93c51914 | |
parent | 6d8d069edc55f1b4bbd656b4bee9124f32f27f7d (diff) | |
download | mongo-c05b9d22da8e01fe7e9fce8ae25da25e95fd448c.tar.gz |
Import wiredtiger: 460513f9f4bc3948a85ef4b772dfbb9ab7949778 from branch mongodb-master
ref: d0ec3886a5..460513f9f4
for: 5.3.0
WT-8601 Timestamps do not work with logged tables.
82 files changed, 513 insertions, 555 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 31caafa0fff..0b5df664156 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -2,5 +2,5 @@ "vendor": "wiredtiger", "github": "wiredtiger/wiredtiger.git", "branch": "mongodb-master", - "commit": "d0ec3886a5081190986c43314f2b701034336c16" + "commit": "460513f9f4bc3948a85ef4b772dfbb9ab7949778" } diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c index 8487e2514f1..4b780de1646 100644 --- a/src/third_party/wiredtiger/src/btree/bt_handle.c +++ b/src/third_party/wiredtiger/src/btree/bt_handle.c @@ -388,11 +388,17 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt) if (WT_IS_METADATA(btree->dhandle)) F_SET(btree, WT_BTREE_IGNORE_CACHE); - WT_RET(__wt_config_gets(session, cfg, "log.enabled", &cval)); - if (cval.val) - F_CLR(btree, WT_BTREE_NO_LOGGING); - else - F_SET(btree, WT_BTREE_NO_LOGGING); + /* + * Turn on logging when it's enabled in the database and not disabled for the tree. (Other code + * only checks the tree flag, so it's important the tree flag match the overall configuration.) + */ + F_SET(btree, WT_BTREE_NO_LOGGING); + if (FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED)) { + WT_ASSERT(session, !F_ISSET(conn, WT_CONN_IN_MEMORY)); + WT_RET(__wt_config_gets(session, cfg, "log.enabled", &cval)); + if (cval.val) + F_CLR(btree, WT_BTREE_NO_LOGGING); + } WT_RET(__wt_config_gets(session, cfg, "tiered_object", &cval)); if (cval.val) @@ -539,8 +545,7 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt) * happen during the recovery due to the unavailability of history store file. */ if (!F_ISSET(conn, WT_CONN_RECOVERING) || WT_IS_METADATA(btree->dhandle) || - __wt_btree_immediately_durable(session) || - ckpt->run_write_gen < conn->last_ckpt_base_write_gen) + !F_ISSET(btree, WT_BTREE_NO_LOGGING) || ckpt->run_write_gen < conn->last_ckpt_base_write_gen) btree->base_write_gen = btree->run_write_gen; else btree->base_write_gen = ckpt->run_write_gen; @@ -989,27 +994,6 @@ __btree_page_sizes(WT_SESSION_IMPL *session) } /* - * __wt_btree_immediately_durable -- - * Check whether this btree is configured for immediate durability. - */ -bool -__wt_btree_immediately_durable(WT_SESSION_IMPL *session) -{ - WT_BTREE *btree; - - btree = S2BT(session); - - /* - * This is used to determine whether timestamp updates should be rolled back for this btree. - * With in-memory, the logging setting on tables is still important and when enabled they should - * be considered "durable". - */ - return ((FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED) || - (F_ISSET(S2C(session), WT_CONN_IN_MEMORY))) && - !F_ISSET(btree, WT_BTREE_NO_LOGGING)); -} - -/* * __wt_btree_switch_object -- * Switch to a writeable object for a tiered btree. */ diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h index 5a05b6c14b5..0a81847cd68 100644 --- a/src/third_party/wiredtiger/src/include/extern.h +++ b/src/third_party/wiredtiger/src/include/extern.h @@ -8,8 +8,6 @@ extern WT_UPDATE *__wt_update_obsolete_check(WT_SESSION_IMPL *session, WT_CURSOR WT_UPDATE *upd, bool update_accounting) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_block_offset_invalid(WT_BLOCK *block, wt_off_t offset, uint32_t size) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); -extern bool __wt_btree_immediately_durable(WT_SESSION_IMPL *session) - WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_cell_type_check(uint8_t cell_type, uint8_t dsk_type) WT_GCC_FUNC_DECL_ATTRIBUTE((warn_unused_result)); extern bool __wt_checksum_alt_match(const void *chunk, size_t len, uint32_t v) diff --git a/src/third_party/wiredtiger/src/include/txn_inline.h b/src/third_party/wiredtiger/src/include/txn_inline.h index dfe431aee14..3f84a80db8b 100644 --- a/src/third_party/wiredtiger/src/include/txn_inline.h +++ b/src/third_party/wiredtiger/src/include/txn_inline.h @@ -329,16 +329,21 @@ __wt_txn_op_delete_commit_apply_timestamps(WT_SESSION_IMPL *session, WT_REF *ref static inline void __wt_txn_op_set_timestamp(WT_SESSION_IMPL *session, WT_TXN_OP *op) { + WT_BTREE *btree; WT_TXN *txn; WT_UPDATE *upd; + btree = op->btree; txn = session->txn; /* - * Updates in the metadata never get timestamps (either now or at commit): metadata cannot be - * read at a point in time, only the most recently committed data matches files on disk. + * Metadata updates, updates with no commit time, and logged objects don't have timestamps, and + * only the most recently committed data matches files on disk. The check for in-memory files + * comes first: in-memory files do have timestamps, but aren't logged. */ - if (WT_IS_METADATA(op->btree->dhandle) || !F_ISSET(txn, WT_TXN_HAS_TS_COMMIT)) + if (WT_IS_METADATA(btree->dhandle) || !F_ISSET(txn, WT_TXN_HAS_TS_COMMIT)) + return; + if (!F_ISSET(S2C(session), WT_CONN_IN_MEMORY) && !F_ISSET(btree, WT_BTREE_NO_LOGGING)) return; if (F_ISSET(txn, WT_TXN_PREPARE)) { @@ -476,7 +481,7 @@ __wt_txn_oldest_id(WT_SESSION_IMPL *session) WT_READ_BARRIER(); if (!F_ISSET(conn, WT_CONN_RECOVERING) || session->dhandle == NULL || - __wt_btree_immediately_durable(session)) { + !F_ISSET(S2BT(session), WT_BTREE_NO_LOGGING)) { /* * Checkpoint transactions often fall behind ordinary application threads. If there is an * active checkpoint, keep changes until checkpoint is finished. diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index fac2f2024db..99aaf0c9021 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -1704,8 +1704,12 @@ __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]) } /* If we are logging, write a commit log record. */ - if (txn->logrec != NULL && FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED) && - !F_ISSET(session, WT_SESSION_NO_LOGGING)) { + if (txn->logrec != NULL) { + /* Assert environment and tree are logging compatible, the fast-check is short-hand. */ + WT_ASSERT(session, + FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED) && + !F_ISSET(session, WT_SESSION_NO_LOGGING)); + /* * We are about to block on I/O writing the log. Release our snapshot in case it is keeping * data pinned. This is particularly important for checkpoints. @@ -1967,8 +1971,7 @@ __wt_txn_prepare(WT_SESSION_IMPL *session, const char *cfg[]) * Logged table updates should never be prepared. As these updates are immediately durable, * it is not possible to roll them back if the prepared transaction is rolled back. */ - if (FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED) && - !F_ISSET(op->btree, WT_BTREE_NO_LOGGING)) + if (!F_ISSET(op->btree, WT_BTREE_NO_LOGGING)) WT_RET_MSG(session, EINVAL, "transaction prepare is not supported with logged tables"); switch (op->type) { case WT_TXN_OP_NONE: diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c index da4a765f95e..c2504ea2cd6 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -1984,11 +1984,8 @@ __checkpoint_tree_helper(WT_SESSION_IMPL *session, const char *cfg[]) /* Are we using a read timestamp for this checkpoint transaction? */ with_timestamp = F_ISSET(txn, WT_TXN_SHARED_TS_READ); - /* - * For tables with immediate durability (indicated by having logging enabled), ignore any read - * timestamp configured for the checkpoint. - */ - if (__wt_btree_immediately_durable(session)) + /* Logged tables ignore any read timestamp configured for the checkpoint. */ + if (!F_ISSET(btree, WT_BTREE_NO_LOGGING)) F_CLR(txn, WT_TXN_SHARED_TS_READ); ret = __checkpoint_tree(session, true, cfg); diff --git a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c index fad51be90e2..854bc7ac0ca 100644 --- a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c +++ b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c @@ -1325,12 +1325,10 @@ __rollback_to_stable_btree(WT_SESSION_IMPL *session, wt_timestamp_t rollback_tim !F_ISSET(btree, WT_BTREE_NO_LOGGING) ? "true" : "false"); /* - * Immediately durable files don't get their commits wiped. This case mostly exists to support - * the semantic required for the oplog in MongoDB - updates that have been made to the oplog - * should not be aborted. It also wouldn't be safe to roll back updates for any table that had - * its records logged: those updates would be recovered after a crash, making them inconsistent. + * Files with commit-level durability don't get their commits wiped. Check in-memory first, + * in-memory files won't have logging turned on. */ - if (__wt_btree_immediately_durable(session)) + if (!F_ISSET(conn, WT_CONN_IN_MEMORY) && !F_ISSET(btree, WT_BTREE_NO_LOGGING)) return (0); /* There is never anything to do for checkpoint handles. */ diff --git a/src/third_party/wiredtiger/test/format/config.c b/src/third_party/wiredtiger/test/format/config.c index b9a4dab93d5..cc814fff7bd 100644 --- a/src/third_party/wiredtiger/test/format/config.c +++ b/src/third_party/wiredtiger/test/format/config.c @@ -1050,11 +1050,13 @@ config_transaction(void) testutil_die(EINVAL, "prepare is incompatible with logging"); } - /* Transaction timestamps are incompatible with implicit transactions. */ + /* Transaction timestamps are incompatible with implicit transactions and logging. */ if (GV(TRANSACTION_TIMESTAMPS) && config_explicit(NULL, "transaction.timestamps")) { if (GV(TRANSACTION_IMPLICIT) && config_explicit(NULL, "transaction.implicit")) testutil_die( EINVAL, "transaction.timestamps is incompatible with implicit transactions"); + if (GV(LOGGING) && config_explicit(NULL, "logging")) + testutil_die(EINVAL, "transaction.timestamps is incompatible with logging"); } /* @@ -1074,11 +1076,15 @@ config_transaction(void) if (GV(TRANSACTION_TIMESTAMPS)) { if (!config_explicit(NULL, "transaction.implicit")) config_off(NULL, "transaction.implicit"); + if (!config_explicit(NULL, "logging")) + config_off(NULL, "logging"); if (!config_explicit(NULL, "ops.salvage")) config_off(NULL, "ops.salvage"); } - if (GV(LOGGING)) + if (GV(LOGGING)) { config_off(NULL, "ops.prepare"); + config_off(NULL, "transaction.timestamps"); + } if (GV(TRANSACTION_IMPLICIT)) config_off(NULL, "transaction.timestamps"); if (GV(OPS_SALVAGE)) diff --git a/src/third_party/wiredtiger/test/suite/test_assert03.py b/src/third_party/wiredtiger/test/suite/test_assert03.py index 51b219b2fac..fead7358cf5 100644 --- a/src/third_party/wiredtiger/test/suite/test_assert03.py +++ b/src/third_party/wiredtiger/test/suite/test_assert03.py @@ -35,15 +35,15 @@ import wiredtiger, wttest from wtscenario import make_scenarios class test_assert03(wttest.WiredTigerTestCase, suite_subprocess): - conn_config = 'log=(enabled)' base_uri = 'file:assert03.wt' always = 'write_timestamp_usage=always,assert=(write_timestamp=on)' never = 'write_timestamp_usage=never,assert=(write_timestamp=on)' none = 'assert=(write_timestamp=off)' key_format_values = [ - ('column', dict(key_format='r', usestrings=False)), - ('string-row', dict(key_format='S', usestrings=True)) + ('col-fix', dict(key_format='r', value_format='8t')), + ('col', dict(key_format='r', value_format='S')), + ('row', dict(key_format='S', value_format='S')) ] scenarios = make_scenarios(key_format_values) @@ -51,17 +51,21 @@ class test_assert03(wttest.WiredTigerTestCase, suite_subprocess): #if not wiredtiger.diagnostic_build(): # self.skipTest('requires a diagnostic build') - cfg = 'key_format={},value_format=S'.format(self.key_format) - key0 = 'key0' if self.usestrings else 17 - key1 = 'key1' if self.usestrings else 18 - key2 = 'key2' if self.usestrings else 19 - key3 = 'key3' if self.usestrings else 20 + cfg = 'key_format={},'.format(self.key_format) + 'value_format={}'.format(self.value_format) + key0 = 'key0' if self.key_format == 'S' else 17 + value0 = 'value0' if self.value_format == 'S' else 0x2a + key1 = 'key1' if self.key_format == 'S' else 18 + value1 = 'value1' if self.value_format == 'S' else 0x2b + key2 = 'key2' if self.key_format == 'S' else 19 + value2 = 'value2' if self.value_format == 'S' else 0x2c + key3 = 'key3' if self.key_format == 'S' else 20 + value3 = 'value3' if self.value_format == 'S' else 0x2d # Create a data item at the default setting self.session.create(self.base_uri, cfg) c = self.session.open_cursor(self.base_uri) self.session.begin_transaction() - c[key0] = 'value0' + c[key0] = value0 self.session.commit_transaction() c.close() @@ -70,7 +74,7 @@ class test_assert03(wttest.WiredTigerTestCase, suite_subprocess): self.session.alter(self.base_uri, self.always) c = self.session.open_cursor(self.base_uri) self.session.begin_transaction() - c[key1] = 'value1' + c[key1] = value1 msg = "/none set on this transaction/" self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda:self.assertEquals(self.session.commit_transaction(), 0), msg) @@ -80,14 +84,14 @@ class test_assert03(wttest.WiredTigerTestCase, suite_subprocess): self.session.alter(self.base_uri, self.never) c = self.session.open_cursor(self.base_uri) self.session.begin_transaction() - c[key2] = 'value2' + c[key2] = value2 self.session.commit_transaction() c.close() self.session.alter(self.base_uri, self.none) c = self.session.open_cursor(self.base_uri) self.session.begin_transaction() - c[key3] = 'value3' + c[key3] = value3 self.session.commit_transaction() c.close() diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint04.py b/src/third_party/wiredtiger/test/suite/test_checkpoint04.py index bec2cf8dd8e..e9411acfe0d 100755 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint04.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint04.py @@ -34,14 +34,13 @@ from wiredtiger import stat from wtdataset import SimpleDataSet class test_checkpoint04(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' def create_tables(self, ntables): tables = {} for i in range(0, ntables): uri = 'table:table' + str(i) - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() tables[uri] = ds return tables diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint07.py b/src/third_party/wiredtiger/test/suite/test_checkpoint07.py index f323da6d2f4..ac8ca33082b 100755 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint07.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint07.py @@ -33,7 +33,7 @@ import wttest from wiredtiger import stat class test_checkpoint07(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' def get_stat(self, uri): stat_uri = 'statistics:' + uri diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint08.py b/src/third_party/wiredtiger/test/suite/test_checkpoint08.py index 1727c077fce..327a8472526 100755 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint08.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint08.py @@ -37,7 +37,7 @@ import wttest from wiredtiger import stat class test_checkpoint08(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' def get_stat(self, uri): stat_uri = 'statistics:' + uri diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint09.py b/src/third_party/wiredtiger/test/suite/test_checkpoint09.py index 63372a3d7a4..ae432b01909 100755 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint09.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint09.py @@ -35,7 +35,7 @@ from wtdataset import SimpleDataSet from wtscenario import make_scenarios class test_checkpoint09(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' format_values = [ ('column-fix', dict(key_format='r', value_format='8t')), diff --git a/src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot03.py b/src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot03.py index dee941908fa..16a9a260147 100644 --- a/src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot03.py +++ b/src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot03.py @@ -54,7 +54,7 @@ class test_checkpoint_snapshot03(wttest.WiredTigerTestCase): scenarios = make_scenarios(format_values) def conn_config(self): - config = 'cache_size=250MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true)' + config = 'cache_size=250MB,statistics=(all),statistics_log=(json,on_close,wait=1)' return config def large_updates(self, uri, value, ds, nrows): @@ -92,7 +92,7 @@ class test_checkpoint_snapshot03(wttest.WiredTigerTestCase): ds = SimpleDataSet(self, self.uri, 0, \ key_format=self.key_format, value_format=self.value_format, \ - config='log=(enabled=false),leaf_page_max=4k') + config='leaf_page_max=4k') ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_compress02.py b/src/third_party/wiredtiger/test/suite/test_compress02.py index 5037dfd654e..1ce1008bc45 100644 --- a/src/third_party/wiredtiger/test/suite/test_compress02.py +++ b/src/third_party/wiredtiger/test/suite/test_compress02.py @@ -41,7 +41,7 @@ class test_compress02(wttest.WiredTigerTestCase): nrows = 1000 def conn_config(self): - config = 'builtin_extension_config={zstd={compression_level=6}},cache_size=10MB,log=(enabled=true)' + config = 'builtin_extension_config={zstd={compression_level=6}},cache_size=10MB' return config def large_updates(self, uri, value, ds, nrows): @@ -72,8 +72,7 @@ class test_compress02(wttest.WiredTigerTestCase): @wttest.zstdtest('Skip zstd on pcc and zseries machines') def test_compress02(self): - - ds = SimpleDataSet(self, self.uri, 0, key_format="S", value_format="S",config='block_compressor=zstd,log=(enabled=false)') + ds = SimpleDataSet(self, self.uri, 0, key_format="S", value_format="S",config='block_compressor=zstd') ds.populate() valuea = "aaaaa" * 100 @@ -87,7 +86,7 @@ class test_compress02(wttest.WiredTigerTestCase): copy_wiredtiger_home(self, ".", "RESTART") # Close the connection and reopen it with a different zstd compression level configuration. - restart_config = 'builtin_extension_config={zstd={compression_level=9}},cache_size=10MB,log=(enabled=true)' + restart_config = 'builtin_extension_config={zstd={compression_level=9}},cache_size=10MB' self.close_conn() self.reopen_conn("RESTART", restart_config) diff --git a/src/third_party/wiredtiger/test/suite/test_debug_mode01.py b/src/third_party/wiredtiger/test/suite/test_debug_mode01.py index e4644d4bd40..5d9a7df795e 100644 --- a/src/third_party/wiredtiger/test/suite/test_debug_mode01.py +++ b/src/third_party/wiredtiger/test/suite/test_debug_mode01.py @@ -31,7 +31,7 @@ import wiredtiger, wttest # test_debug_mode01.py # Test the debug mode settings. Test rollback_error in this one. class test_debug_mode01(wttest.WiredTigerTestCase): - conn_config = 'log=(enabled=true),debug_mode=(rollback_error=5)' + conn_config = 'debug_mode=(rollback_error=5)' uri = 'file:test_debug' entries = 22 diff --git a/src/third_party/wiredtiger/test/suite/test_debug_mode04.py b/src/third_party/wiredtiger/test/suite/test_debug_mode04.py index 190973c46a1..7a054fabd1e 100644 --- a/src/third_party/wiredtiger/test/suite/test_debug_mode04.py +++ b/src/third_party/wiredtiger/test/suite/test_debug_mode04.py @@ -31,7 +31,7 @@ import wttest # test_debug_mode04.py # Test the debug mode settings. Test eviction use. class test_debug_mode04(wttest.WiredTigerTestCase): - conn_config = 'log=(enabled=true,file_max=100K),debug_mode=(eviction=true)' + conn_config = 'debug_mode=(eviction=true)' uri = 'file:test_debug' entries = 100 value = b'\x01\x02abcd\x03\x04' @@ -45,11 +45,11 @@ class test_debug_mode04(wttest.WiredTigerTestCase): # Just test turning it on and off. There really isn't something # specific to verify. - def test_table_logging(self): + def test_table_eviction(self): self.session.create(self.uri, 'key_format=i,value_format=u') self.add_data() - def test_table_logging_off(self): + def test_table_eviction_off(self): self.conn.reconfigure("debug_mode=(eviction=false)") self.session.create(self.uri, 'key_format=i,value_format=u') self.add_data() diff --git a/src/third_party/wiredtiger/test/suite/test_debug_mode06.py b/src/third_party/wiredtiger/test/suite/test_debug_mode06.py index 3fecacdca01..56795bc44af 100644 --- a/src/third_party/wiredtiger/test/suite/test_debug_mode06.py +++ b/src/third_party/wiredtiger/test/suite/test_debug_mode06.py @@ -32,7 +32,7 @@ import wttest, wiredtiger # Test the debug mode settings. Test slow_checkpoint use (from WT-4981). # Note: testing timing will make results unreliable so we won't do that. class test_debug_mode06(wttest.WiredTigerTestCase): - conn_config = 'log=(enabled=true),debug_mode=(slow_checkpoint=true),statistics=(all)' + conn_config = 'debug_mode=(slow_checkpoint=true),statistics=(all)' uri = 'file:test_debug_mode06' # Insert some data to ensure setting/unsetting the flag does not diff --git a/src/third_party/wiredtiger/test/suite/test_debug_mode07.py b/src/third_party/wiredtiger/test/suite/test_debug_mode07.py index bf6669e88d9..b4d173fef4b 100644 --- a/src/third_party/wiredtiger/test/suite/test_debug_mode07.py +++ b/src/third_party/wiredtiger/test/suite/test_debug_mode07.py @@ -31,7 +31,7 @@ import wttest # test_debug_mode07.py # Test the debug mode settings. Test realloc_exact use (from WT-4919). class test_debug_mode07(wttest.WiredTigerTestCase): - conn_config = 'log=(enabled=true),debug_mode=(realloc_exact=true)' + conn_config = 'debug_mode=(realloc_exact=true)' uri = 'file:test_debug_mode07' # Insert some data to ensure setting/unsetting the flag does not diff --git a/src/third_party/wiredtiger/test/suite/test_gc01.py b/src/third_party/wiredtiger/test/suite/test_gc01.py index e25847e3f48..763f2fa1f38 100755 --- a/src/third_party/wiredtiger/test/suite/test_gc01.py +++ b/src/third_party/wiredtiger/test/suite/test_gc01.py @@ -81,15 +81,14 @@ class test_gc_base(wttest.WiredTigerTestCase): class test_gc01(test_gc_base): # Force a small cache. conn_config = ('cache_size=50MB,eviction_updates_trigger=95,eviction_updates_target=80,' - 'log=(enabled),statistics=(all)') + 'statistics=(all)') def test_gc(self): nrows = 10000 # Create a table without logging. uri = "table:gc01" - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_gc02.py b/src/third_party/wiredtiger/test/suite/test_gc02.py index 8d2dfc30e4a..ee6dff96634 100755 --- a/src/third_party/wiredtiger/test/suite/test_gc02.py +++ b/src/third_party/wiredtiger/test/suite/test_gc02.py @@ -33,15 +33,14 @@ from wtdataset import SimpleDataSet # test_gc02.py # Test that checkpoint cleans the obsolete history store internal pages. class test_gc02(test_gc_base): - conn_config = 'cache_size=1GB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=1GB,statistics=(all)' def test_gc(self): nrows = 100000 # Create a table without logging. uri = "table:gc02" - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_gc03.py b/src/third_party/wiredtiger/test/suite/test_gc03.py index 1ec66c5fd69..faafdf244ca 100755 --- a/src/third_party/wiredtiger/test/suite/test_gc03.py +++ b/src/third_party/wiredtiger/test/suite/test_gc03.py @@ -33,7 +33,7 @@ from wtdataset import SimpleDataSet # test_gc03.py # Test that checkpoint cleans the obsolete history store pages that are in-memory. class test_gc03(test_gc_base): - conn_config = 'cache_size=4GB,log=(enabled),statistics=(all),statistics_log=(wait=0,on_close=true)' + conn_config = 'cache_size=4GB,statistics=(all),statistics_log=(wait=0,on_close=true)' def get_stat(self, stat): stat_cursor = self.session.open_cursor('statistics:') @@ -44,16 +44,14 @@ class test_gc03(test_gc_base): def test_gc(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:gc03" - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() - # Create an extra table without logging. + # Create an extra table. uri_extra = "table:gc03_extra" - ds_extra = SimpleDataSet( - self, uri_extra, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds_extra = SimpleDataSet(self, uri_extra, 0, key_format="i", value_format="S") ds_extra.populate() # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_gc04.py b/src/third_party/wiredtiger/test/suite/test_gc04.py index ce814079b3a..ed59c5d2bc9 100755 --- a/src/third_party/wiredtiger/test/suite/test_gc04.py +++ b/src/third_party/wiredtiger/test/suite/test_gc04.py @@ -33,7 +33,7 @@ from wtdataset import SimpleDataSet # test_gc04.py # Test that checkpoint must not clean the pages that are not obsolete. class test_gc04(test_gc_base): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' def get_stat(self, stat): stat_cursor = self.session.open_cursor('statistics:') @@ -44,10 +44,9 @@ class test_gc04(test_gc_base): def test_gc(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:gc04" - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_gc05.py b/src/third_party/wiredtiger/test/suite/test_gc05.py index d5af63255b9..325d035d96f 100755 --- a/src/third_party/wiredtiger/test/suite/test_gc05.py +++ b/src/third_party/wiredtiger/test/suite/test_gc05.py @@ -32,7 +32,7 @@ from wtdataset import SimpleDataSet # test_gc05.py # Verify a locked checkpoint is not removed during garbage collection. class test_gc05(test_gc_base): - conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)' + conn_config = 'cache_size=50MB,statistics=(all)' def test_gc(self): uri = "table:gc05" @@ -43,8 +43,7 @@ class test_gc05(test_gc_base): value_x = "xxxxx" * 100 value_y = "yyyyy" * 100 value_z = "zzzzz" * 100 - ds = SimpleDataSet( - self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format="i", value_format="S") ds.populate() # Set the oldest and stable timestamps to 10. diff --git a/src/third_party/wiredtiger/test/suite/test_hs02.py b/src/third_party/wiredtiger/test/suite/test_hs02.py index 1575d2ab1b5..be193737f78 100644 --- a/src/third_party/wiredtiger/test/suite/test_hs02.py +++ b/src/third_party/wiredtiger/test/suite/test_hs02.py @@ -34,7 +34,7 @@ from wtscenario import make_scenarios # Test that truncate with history store entries and timestamps gives expected results. class test_hs02(wttest.WiredTigerTestCase): # Force a small cache. - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' format_values = [ ('string-row', dict(key_format='S', value_format='S')), @@ -76,15 +76,12 @@ class test_hs02(wttest.WiredTigerTestCase): def test_hs(self): nrows = 10000 - # Create a table without logging to ensure we get "skew_newest" history store eviction - # behavior. - uri = "table:las02_main" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + # Create a table. + uri = "table:hs02_main" + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() - uri2 = "table:las02_extra" + uri2 = "table:hs02_extra" ds2 = SimpleDataSet( self, uri2, 0, key_format=self.key_format, value_format=self.value_format) ds2.populate() diff --git a/src/third_party/wiredtiger/test/suite/test_hs07.py b/src/third_party/wiredtiger/test/suite/test_hs07.py index 29bb930a657..bae779fb097 100644 --- a/src/third_party/wiredtiger/test/suite/test_hs07.py +++ b/src/third_party/wiredtiger/test/suite/test_hs07.py @@ -32,11 +32,10 @@ from wtdataset import SimpleDataSet from wtscenario import make_scenarios # test_hs07.py -# Test that the history store sweep cleans the obsolete history store entries and gives expected results. +# Test history store sweep cleans the obsolete history store entries and gives expected results. class test_hs07(wttest.WiredTigerTestCase): # Force a small cache. - conn_config = ('cache_size=50MB,eviction_updates_trigger=95,' - 'eviction_updates_target=80,log=(enabled)') + conn_config = ('cache_size=50MB,eviction_updates_trigger=95,eviction_updates_target=80') format_values = ( ('column', dict(key_format='r', value_format='S')), @@ -69,15 +68,12 @@ class test_hs07(wttest.WiredTigerTestCase): def test_hs(self): nrows = 10000 - # Create a table without logging to ensure we get "skew_newest" history store eviction - # behavior. - uri = "table:las07_main" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + # Create a table. + uri = "table:hs07_main" + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() - uri2 = "table:las07_extra" + uri2 = "table:hs07_extra" ds2 = SimpleDataSet( self, uri2, 0, key_format=self.key_format, value_format=self.value_format) ds2.populate() diff --git a/src/third_party/wiredtiger/test/suite/test_import01.py b/src/third_party/wiredtiger/test/suite/test_import01.py index 24ab7f22c2d..79a6e45a8e2 100644 --- a/src/third_party/wiredtiger/test/suite/test_import01.py +++ b/src/third_party/wiredtiger/test/suite/test_import01.py @@ -99,14 +99,12 @@ class test_import_base(wttest.WiredTigerTestCase): # Copy a file from a source directory to a destination directory. def copy_file(self, file_name, src_dir, dest_dir): src_path = os.path.join(src_dir, file_name) - if os.path.isfile(src_path) and "WiredTiger.lock" not in file_name and \ - "Tmplog" not in file_name and "Preplog" not in file_name: + if os.path.isfile(src_path) and "WiredTiger.lock" not in file_name: shutil.copy(src_path, dest_dir) # test_import01 class test_import01(test_import_base): - - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' original_db_file = 'original_db_file' uri = 'file:' + original_db_file @@ -117,7 +115,7 @@ class test_import01(test_import_base): values = [b'\x01\x02aaa\x03\x04', b'\x01\x02bbb\x03\x04', b'\x01\x02ccc\x03\x04', b'\x01\x02ddd\x03\x04', b'\x01\x02eee\x03\x04', b'\x01\x02fff\x03\x04'] ts = [10*k for k in range(1, len(keys)+1)] - create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u' + create_config = 'allocation_size=512,key_format=u,value_format=u' def test_file_import(self): self.session.create(self.uri, self.create_config) diff --git a/src/third_party/wiredtiger/test/suite/test_import02.py b/src/third_party/wiredtiger/test/suite/test_import02.py index b22f3b9e6fc..a72ee880bf3 100644 --- a/src/third_party/wiredtiger/test/suite/test_import02.py +++ b/src/third_party/wiredtiger/test/suite/test_import02.py @@ -34,7 +34,7 @@ import wiredtiger from test_import01 import test_import_base class test_import02(test_import_base): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' original_db_file = 'original_db_file' uri = 'file:' + original_db_file @@ -45,7 +45,7 @@ class test_import02(test_import_base): values = [b'\x01\x02aaa\x03\x04', b'\x01\x02bbb\x03\x04', b'\x01\x02ccc\x03\x04', b'\x01\x02ddd\x03\x04', b'\x01\x02eee\x03\x04', b'\x01\x02fff\x03\x04'] ts = [10*k for k in range(1, len(keys)+1)] - create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u' + create_config = 'allocation_size=512,key_format=u,value_format=u' # The cases where 'file_metadata' is empty or the config option itself is missing entirely are # almost identical. Let's capture this in a helper and call them from each test. diff --git a/src/third_party/wiredtiger/test/suite/test_import03.py b/src/third_party/wiredtiger/test/suite/test_import03.py index 86bb3dd1a4b..73e0d67debb 100644 --- a/src/third_party/wiredtiger/test/suite/test_import03.py +++ b/src/third_party/wiredtiger/test/suite/test_import03.py @@ -34,7 +34,7 @@ from wtscenario import make_scenarios from test_import01 import test_import_base class test_import03(test_import_base): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' ntables = 10 nrows = 100 @@ -69,7 +69,7 @@ class test_import03(test_import_base): original_db_table = 'original_db_table' uri = 'table:' + original_db_table - create_config = 'allocation_size=512,log=(enabled=true),' + self.config + create_config = 'allocation_size=512,' + self.config self.session.create(uri, create_config) keys = self.keys diff --git a/src/third_party/wiredtiger/test/suite/test_import04.py b/src/third_party/wiredtiger/test/suite/test_import04.py index 20184c51e2c..f2ff1626f28 100644 --- a/src/third_party/wiredtiger/test/suite/test_import04.py +++ b/src/third_party/wiredtiger/test/suite/test_import04.py @@ -54,7 +54,7 @@ from wtscenario import make_scenarios from test_import01 import test_import_base class test_import04(test_import_base): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' ntables = 10 nrows = 100 @@ -90,7 +90,7 @@ class test_import04(test_import_base): # Create the target table for import tests. original_db_table = 'original_db_table' uri = 'table:' + original_db_table - create_config = 'allocation_size=512,log=(enabled=true),' + self.config + create_config = 'allocation_size=512,' + self.config self.session.create(uri, create_config) keys = self.keys diff --git a/src/third_party/wiredtiger/test/suite/test_import05.py b/src/third_party/wiredtiger/test/suite/test_import05.py index 8f7a56d4dd3..c0936e36627 100644 --- a/src/third_party/wiredtiger/test/suite/test_import05.py +++ b/src/third_party/wiredtiger/test/suite/test_import05.py @@ -35,7 +35,7 @@ from wtscenario import make_scenarios from test_import01 import test_import_base class test_import05(test_import_base): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' ntables = 10 nrows = 100 @@ -60,7 +60,7 @@ class test_import05(test_import_base): def test_file_import_ts_past_global_ts(self): original_db_file = 'original_db_file' uri = 'file:' + original_db_file - create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u' + create_config = 'allocation_size=512,key_format=u,value_format=u' self.session.create(uri, create_config) # Add data and perform a checkpoint. diff --git a/src/third_party/wiredtiger/test/suite/test_import06.py b/src/third_party/wiredtiger/test/suite/test_import06.py index 444b7f777c4..f56c7a218d0 100644 --- a/src/third_party/wiredtiger/test/suite/test_import06.py +++ b/src/third_party/wiredtiger/test/suite/test_import06.py @@ -44,7 +44,7 @@ class test_import06(test_import_base): values = [b'\x01\x02aaa\x03\x04', b'\x01\x02bbb\x03\x04', b'\x01\x02ccc\x03\x04', b'\x01\x02ddd\x03\x04', b'\x01\x02eee\x03\x04', b'\x01\x02fff\x03\x04'] ts = [10*k for k in range(1, len(keys)+1)] - create_config = 'allocation_size={},key_format=u,log=(enabled=true),value_format=u,' \ + create_config = 'allocation_size={},key_format=u,value_format=u,' \ 'block_compressor={},encryption=(name={})' # To test the sodium encryptor, we use secretkey= rather than @@ -86,8 +86,7 @@ class test_import06(test_import_base): extlist.extension('encryptors', self.encryptor) def conn_config(self): - return 'cache_size=50MB,log=(enabled),encryption=(name={})'.format( - self.encryptor + self.encryptor_args) + return 'cache_size=50MB,encryption=(name={})'.format(self.encryptor + self.encryptor_args) def test_import_repair(self): self.session.create(self.uri, diff --git a/src/third_party/wiredtiger/test/suite/test_import07.py b/src/third_party/wiredtiger/test/suite/test_import07.py index a6548491265..4ebcafd24e5 100644 --- a/src/third_party/wiredtiger/test/suite/test_import07.py +++ b/src/third_party/wiredtiger/test/suite/test_import07.py @@ -35,7 +35,7 @@ from wtscenario import make_scenarios class test_import07(test_import_base): original_db_file = 'original_db_file' - create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u' + create_config = 'allocation_size=512,key_format=u,value_format=u' ntables = 10 nrows = 100 diff --git a/src/third_party/wiredtiger/test/suite/test_import08.py b/src/third_party/wiredtiger/test/suite/test_import08.py index eeafddf74a8..bfa06bfc184 100644 --- a/src/third_party/wiredtiger/test/suite/test_import08.py +++ b/src/third_party/wiredtiger/test/suite/test_import08.py @@ -34,7 +34,7 @@ from test_import01 import test_import_base from wtscenario import make_scenarios class test_import08(test_import_base): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' original_db_file = 'original_db_file' uri = 'file:' + original_db_file @@ -45,7 +45,7 @@ class test_import08(test_import_base): values = [b'\x01\x02aaa\x03\x04', b'\x01\x02bbb\x03\x04', b'\x01\x02ccc\x03\x04', b'\x01\x02ddd\x03\x04', b'\x01\x02eee\x03\x04', b'\x01\x02fff\x03\x04'] ts = [10*k for k in range(1, len(keys)+1)] - create_config = 'allocation_size=512,key_format=u,log=(enabled=true),value_format=u' + create_config = 'allocation_size=512,key_format=u,value_format=u' scenarios = make_scenarios([ ('file_metadata', dict(repair=False)), ('repair', dict(repair=True)), diff --git a/src/third_party/wiredtiger/test/suite/test_import09.py b/src/third_party/wiredtiger/test/suite/test_import09.py index b4c50cea867..e5ba1be8e0f 100644 --- a/src/third_party/wiredtiger/test/suite/test_import09.py +++ b/src/third_party/wiredtiger/test/suite/test_import09.py @@ -99,8 +99,7 @@ class test_import09(test_import_base): extlist.extension('encryptors', self.encryptor) def conn_config(self): - return 'cache_size=50MB,log=(enabled),encryption=(name={})'.format( - self.encryptor + self.encryptor_args) + return 'cache_size=50MB,encryption=(name={})'.format(self.encryptor + self.encryptor_args) def test_import_table_repair(self): # Add some tables & data and checkpoint. @@ -110,7 +109,7 @@ class test_import09(test_import_base): # Create the table targeted for import. original_db_table = 'original_db_table' uri = 'table:' + original_db_table - create_config = ('allocation_size={},log=(enabled=true),block_compressor={},' + create_config = ('allocation_size={},block_compressor={},' 'encryption=(name={}),') + self.config self.session.create(uri, create_config.format(self.allocsize, self.compressor, self.encryptor)) @@ -164,7 +163,7 @@ class test_import09(test_import_base): self.copy_file(original_db_table + '.wt', '.', newdir) # Construct the config string. - import_config = 'log=(enabled=true),import=(enabled,repair=true)' + import_config = 'import=(enabled,repair=true)' # Import the file. self.session.create(uri, import_config) diff --git a/src/third_party/wiredtiger/test/suite/test_log04.py b/src/third_party/wiredtiger/test/suite/test_log04.py new file mode 100644 index 00000000000..19a8d73bf68 --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_log04.py @@ -0,0 +1,159 @@ +#!/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 wiredtiger, wttest +from wtscenario import make_scenarios +from wtdataset import SimpleDataSet + +# test_log04.py +# Smoke test logging with timestamp configurations. +class test_log04(wttest.WiredTigerTestCase): + conn_config = 'log=(enabled)' + + types = [ + ('col', dict(key_format='r',value_format='S')), + ('fix', dict(key_format='r',value_format='8t')), + ('row', dict(key_format='S',value_format='S')), + ] + ckpt = [ + ('ckpt', dict(ckpt=True)), + ('no-ckpt', dict(ckpt=False)), + ] + scenarios = make_scenarios(types, ckpt) + + def check(self, cursor, read_ts, key, value): + self.session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts)) + self.assertEqual(cursor[key], value) + self.session.rollback_transaction() + + def test_logts(self): + # Create logged and non-logged objects. The non-logged objects are in two versions, one is + # updated with a commit timestamp and one is not. Update the logged and non-logged timestamp + # tables in a transaction with a commit timestamp and confirm the timestamps only apply to + # the non-logged object. Update the non-logged, non-timestamp table in a transaction without + # a commit timestamp, and confirm timestamps are ignored. + uri_log = 'table:test_logts.log' + ds_log = SimpleDataSet(self, uri_log, 100, + key_format=self.key_format, value_format=self.value_format) + ds_log.populate() + c_log = self.session.open_cursor(uri_log) + + uri_ts = 'table:test_logts.ts' + ds_ts = SimpleDataSet(self, uri_ts, 100, + key_format=self.key_format, value_format=self.value_format, + config='log=(enabled=false)') + ds_ts.populate() + c_ts = self.session.open_cursor(uri_ts) + + uri_nots = 'table:test_log04.nots' + ds_nots = SimpleDataSet(self, uri_nots, 100, + key_format=self.key_format, value_format=self.value_format, + config='log=(enabled=false)') + ds_nots.populate() + c_nots = self.session.open_cursor(uri_nots) + + # Set oldest and stable timestamps to 10. + self.conn.set_timestamp( + 'oldest_timestamp=' + self.timestamp_str(10) + + ',stable_timestamp=' + self.timestamp_str(10)) + + key = ds_ts.key(10) + value10 = ds_ts.value(10) + + # Confirm initial data at timestamp 10. + self.check(c_log, 10, key, value10) + self.check(c_ts, 10, key, value10) + self.check(c_nots, 10, key, value10) + + # Update and then rollback. + value50 = ds_ts.value(50) + self.session.begin_transaction() + c_log[key] = value50 + c_ts[key] = value50 + c_nots[key] = value50 + self.session.rollback_transaction() + + # Confirm data at time 10 and 20. + self.check(c_log, 10, key, value10) + self.check(c_ts, 10, key, value10) + self.check(c_nots, 10, key, value10) + self.check(c_log, 20, key, value10) + self.check(c_ts, 20, key, value10) + self.check(c_nots, 20, key, value10) + + # Update and then commit data at time 20. + value55 = ds_ts.value(55) + self.session.begin_transaction() + c_log[key] = value55 + c_ts[key] = value55 + self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(20)) + self.session.begin_transaction() + c_nots[key] = value55 + self.session.commit_transaction() + + # Confirm data at time 10 and 20. + self.check(c_log, 10, key, value55) + self.check(c_ts, 10, key, value10) + self.check(c_nots, 10, key, value55) + self.check(c_log, 20, key, value55) + self.check(c_nots, 20, key, value55) + + # Update and then commit data at time 30. + value60 = ds_ts.value(60) + self.session.begin_transaction() + c_log[key] = value60 + c_ts[key] = value60 + self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(30)) + self.session.begin_transaction() + c_nots[key] = value60 + self.session.commit_transaction() + + # Confirm data at time 20 and 30 + self.check(c_log, 20, key, value60) + self.check(c_ts, 20, key, value55) + self.check(c_nots, 20, key, value60) + self.check(c_log, 30, key, value60) + self.check(c_ts, 30, key, value60) + self.check(c_nots, 30, key, value60) + + # Move the stable timestamp to 25. Checkpoint and rollback to a timestamp. + self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(25)) + if self.ckpt: + self.session.checkpoint() + self.conn.rollback_to_stable() + + # Confirm data at time 20 and 30. + self.check(c_log, 20, key, value60) + self.check(c_ts, 20, key, value55) + self.check(c_nots, 20, key, value60) + self.check(c_log, 30, key, value60) + self.check(c_ts, 30, key, value55) + self.check(c_nots, 30, key, value60) + +if __name__ == '__main__': + wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_prepare04.py b/src/third_party/wiredtiger/test/suite/test_prepare04.py index b692a36ed00..218323093e2 100644 --- a/src/third_party/wiredtiger/test/suite/test_prepare04.py +++ b/src/third_party/wiredtiger/test/suite/test_prepare04.py @@ -47,10 +47,10 @@ class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess): after_ts = timestamp_str(250) types = [ - ('col', dict(extra_config=',log=(enabled=false),key_format=r')), - ('col-fix', dict(extra_config=',log=(enabled=false),key_format=r,value_format=8t')), - ('lsm', dict(extra_config=',log=(enabled=false),type=lsm')), - ('row', dict(extra_config=',log=(enabled=false)')), + ('col', dict(extra_config=',key_format=r')), + ('col-fix', dict(extra_config=',key_format=r,value_format=8t')), + ('lsm', dict(extra_config=',type=lsm')), + ('row', dict(extra_config='')), ] # Various begin_transaction config @@ -64,7 +64,6 @@ class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess): ('ignore_false', dict(ignore_config=',ignore_prepare=false', ignore=False)), ('ignore_true', dict(ignore_config=',ignore_prepare=true', ignore=True)), ] - conn_config = 'log=(enabled)' scenarios = make_scenarios(types, txncfg, preparecfg) diff --git a/src/third_party/wiredtiger/test/suite/test_prepare15.py b/src/third_party/wiredtiger/test/suite/test_prepare15.py index c89bbd10e0b..3d1c111da77 100644 --- a/src/third_party/wiredtiger/test/suite/test_prepare15.py +++ b/src/third_party/wiredtiger/test/suite/test_prepare15.py @@ -57,12 +57,10 @@ class test_prepare15(wttest.WiredTigerTestCase): config = 'cache_size=50MB' if self.in_memory: config += ',in_memory=true' - else: - config += ',in_memory=false' return config def test_prepare_hs_update_and_tombstone(self): - # Create a table without logging. + # Create a table. uri = "table:prepare15" create_config = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_config) @@ -147,7 +145,7 @@ class test_prepare15(wttest.WiredTigerTestCase): self.session.commit_transaction() def test_prepare_hs_update(self): - # Create a table without logging. + # Create a table. uri = "table:prepare15" create_config = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_config) @@ -250,7 +248,7 @@ class test_prepare15(wttest.WiredTigerTestCase): self.session.commit_transaction() def test_prepare_no_hs(self): - # Create a table without logging. + # Create a table. uri = "table:prepare15" create_config = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_config) diff --git a/src/third_party/wiredtiger/test/suite/test_prepare_hs02.py b/src/third_party/wiredtiger/test/suite/test_prepare_hs02.py index d09cd4ee96b..c9f6659245f 100644 --- a/src/third_party/wiredtiger/test/suite/test_prepare_hs02.py +++ b/src/third_party/wiredtiger/test/suite/test_prepare_hs02.py @@ -40,10 +40,10 @@ class test_prepare_hs02(wttest.WiredTigerTestCase, suite_subprocess): uri = 'table:' + tablename types = [ - ('col', dict(s_config='key_format=r,value_format=i,log=(enabled=false)')), - ('col-fix', dict(s_config='key_format=r,value_format=8t,log=(enabled=false)')), - ('row', dict(s_config='key_format=i,value_format=i,log=(enabled=false)')), - ('lsm', dict(s_config='key_format=i,value_format=i,log=(enabled=false),type=lsm')), + ('col', dict(s_config='key_format=r,value_format=i')), + ('col-fix', dict(s_config='key_format=r,value_format=8t')), + ('row', dict(s_config='key_format=i,value_format=i')), + ('lsm', dict(s_config='key_format=i,value_format=i,type=lsm')), ] # Transaction end types @@ -71,7 +71,8 @@ class test_prepare_hs02(wttest.WiredTigerTestCase, suite_subprocess): self.session.prepare_transaction('prepare_timestamp=' + self.timestamp_str(100)) if self.txn_commit == True: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(101) + ',durable_timestamp=' + self.timestamp_str(101)) + 'commit_timestamp=' + self.timestamp_str(101) +\ + ',durable_timestamp=' + self.timestamp_str(101)) else: self.session.rollback_transaction() @@ -93,7 +94,8 @@ class test_prepare_hs02(wttest.WiredTigerTestCase, suite_subprocess): self.session.prepare_transaction('prepare_timestamp=' + self.timestamp_str(200)) if self.txn_commit == True: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(201) + ',durable_timestamp=' + self.timestamp_str(201)) + 'commit_timestamp=' + self.timestamp_str(201) +\ + ',durable_timestamp=' + self.timestamp_str(201)) else: self.session.rollback_transaction() @@ -120,7 +122,8 @@ class test_prepare_hs02(wttest.WiredTigerTestCase, suite_subprocess): self.session.prepare_transaction('prepare_timestamp=' + self.timestamp_str(300)) if self.txn_commit == True: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(301) + ',durable_timestamp=' + self.timestamp_str(301)) + 'commit_timestamp=' + self.timestamp_str(301) +\ + ',durable_timestamp=' + self.timestamp_str(301)) else: self.session.rollback_transaction() @@ -158,7 +161,8 @@ class test_prepare_hs02(wttest.WiredTigerTestCase, suite_subprocess): self.session.prepare_transaction('prepare_timestamp=' + self.timestamp_str(400)) if self.txn_commit == True: self.session.commit_transaction( - 'commit_timestamp=' + self.timestamp_str(401) + ',durable_timestamp=' + self.timestamp_str(401)) + 'commit_timestamp=' + self.timestamp_str(401) +\ + ',durable_timestamp=' + self.timestamp_str(401)) else: self.session.rollback_transaction() diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py index c44a69a5860..04bd4aa6bd0 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable01.py @@ -206,18 +206,14 @@ class test_rollback_to_stable01(test_rollback_to_stable_base): config = 'cache_size=50MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable01" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable02.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable02.py index 8d0c9e66d05..6a9dc35f368 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable02.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable02.py @@ -68,18 +68,15 @@ class test_rollback_to_stable02(test_rollback_to_stable_base): config = 'cache_size=100MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable02" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.extraconfig) + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config=self.extraconfig) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable03.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable03.py index e3bda2548d8..ea2c8dcde04 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable03.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable03.py @@ -58,18 +58,14 @@ class test_rollback_to_stable01(test_rollback_to_stable_base): config = 'cache_size=4GB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable03" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py index ae445b4bff2..c23a40bc253 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py @@ -61,18 +61,14 @@ class test_rollback_to_stable04(test_rollback_to_stable_base): config = 'cache_size=500MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable04" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable05.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable05.py index d21b17c1dda..78820cef418 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable05.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable05.py @@ -58,24 +58,20 @@ class test_rollback_to_stable05(test_rollback_to_stable_base): config = 'cache_size=50MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 1000 - # Create two tables without logging. + # Create two tables. uri_1 = "table:rollback_to_stable05_1" ds_1 = SimpleDataSet( - self, uri_1, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, uri_1, 0, key_format=self.key_format, value_format=self.value_format) ds_1.populate() uri_2 = "table:rollback_to_stable05_2" ds_2 = SimpleDataSet( - self, uri_2, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, uri_2, 0, key_format=self.key_format, value_format=self.value_format) ds_2.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py index f7fe6129487..391894cbf09 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py @@ -58,18 +58,14 @@ class test_rollback_to_stable06(test_rollback_to_stable_base): config = 'cache_size=50MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable06" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable07.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable07.py index 547867e569a..f9e045e0a81 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable07.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable07.py @@ -53,17 +53,15 @@ class test_rollback_to_stable07(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=5MB,statistics=(all),log=(enabled=true)' + config = 'cache_size=5MB,statistics=(all)' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable07" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable08.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable08.py index 04a303fef2b..1d567bf0c3a 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable08.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable08.py @@ -58,18 +58,14 @@ class test_rollback_to_stable08(test_rollback_to_stable_base): config = 'cache_size=50MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def test_rollback_to_stable(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable08" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable09.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable09.py index d797519a5c4..69dc6e23f46 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable09.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable09.py @@ -63,8 +63,6 @@ class test_rollback_to_stable09(test_rollback_to_stable_base): config = 'cache_size=250MB' if self.in_memory: config += ',in_memory=true' - else: - config += ',log=(enabled),in_memory=false' return config def create_table(self, commit_ts): diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py index 369e387ac65..2571d694c6a 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable10.py @@ -53,25 +53,23 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' + config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),timing_stress_for_test=[history_store_checkpoint_delay]' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. self.pr("create/populate tables") uri_1 = "table:rollback_to_stable10_1" ds_1 = SimpleDataSet( - self, uri_1, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, uri_1, 0, key_format=self.key_format, value_format=self.value_format) ds_1.populate() - # Create another table without logging. + # Create another table. uri_2 = "table:rollback_to_stable10_2" ds_2 = SimpleDataSet( - self, uri_2, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, uri_2, 0, key_format=self.key_format, value_format=self.value_format) ds_2.populate() if self.value_format == '8t': @@ -190,19 +188,19 @@ class test_rollback_to_stable10(test_rollback_to_stable_base): def test_rollback_to_stable_prepare(self): nrows = 1000 - # Create a table without logging. + # Create a table. self.pr("create/populate tables") uri_1 = "table:rollback_to_stable10_1" ds_1 = SimpleDataSet( self, uri_1, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.prepare_extraconfig) + config=self.prepare_extraconfig) ds_1.populate() - # Create another table without logging. + # Create another table. uri_2 = "table:rollback_to_stable10_2" ds_2 = SimpleDataSet( self, uri_2, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.prepare_extraconfig) + config=self.prepare_extraconfig) ds_2.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py index beacb3c6f75..0ebd1513194 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable11.py @@ -50,7 +50,7 @@ class test_rollback_to_stable11(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=1MB,statistics=(all),log=(enabled=true,remove=false)' + config = 'cache_size=1MB,statistics=(all)' return config def test_rollback_to_stable(self): @@ -58,9 +58,7 @@ class test_rollback_to_stable11(test_rollback_to_stable_base): # Create a table without logging. uri = "table:rollback_to_stable11" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable12.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable12.py index c54ae01e9f1..1fb3809605d 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable12.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable12.py @@ -56,17 +56,16 @@ class test_rollback_to_stable12(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=500MB,statistics=(all),log=(enabled=true)' + config = 'cache_size=500MB,statistics=(all)' return config def test_rollback_to_stable(self): nrows = 1000000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable12" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='split_pct=50,log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config='split_pct=50') ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable13.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable13.py index 9ca468d38b5..fc4b2a9bdff 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable13.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable13.py @@ -50,17 +50,16 @@ class test_rollback_to_stable13(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=50MB,statistics=(all),log=(enabled=true)' + config = 'cache_size=50MB,statistics=(all)' return config def test_rollback_to_stable(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable13" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='split_pct=50,log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config='split_pct=50') ds.populate() if self.value_format == '8t': @@ -112,11 +111,10 @@ class test_rollback_to_stable13(test_rollback_to_stable_base): def test_rollback_to_stable_with_aborted_updates(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable13" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='split_pct=50,log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config='split_pct=50') ds.populate() if self.value_format == '8t': @@ -188,11 +186,10 @@ class test_rollback_to_stable13(test_rollback_to_stable_base): def test_rollback_to_stable_with_history_tombstone(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable13" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='split_pct=50,log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config='split_pct=50') ds.populate() if self.value_format == '8t': @@ -257,11 +254,10 @@ class test_rollback_to_stable13(test_rollback_to_stable_base): def test_rollback_to_stable_with_stable_remove(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable13" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='split_pct=50,log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, + config='split_pct=50') ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py index 6930b91ed07..f79554cf639 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable14.py @@ -60,18 +60,16 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): scenarios = make_scenarios(key_format_values, prepare_values) def conn_config(self): - config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[history_store_checkpoint_delay]' + config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),timing_stress_for_test=[history_store_checkpoint_delay]' return config def test_rollback_to_stable(self): nrows = 100 - # Create a table without logging. + # Create a table. self.pr("create/populate table") uri = "table:rollback_to_stable14" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() # Pin oldest and stable to timestamp 10. @@ -178,12 +176,10 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): def test_rollback_to_stable_same_ts(self): nrows = 100 - # Create a table without logging. + # Create a table. self.pr("create/populate table") uri = "table:rollback_to_stable14" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() # Pin oldest and stable to timestamp 10. @@ -288,12 +284,10 @@ class test_rollback_to_stable14(test_rollback_to_stable_base): def test_rollback_to_stable_same_ts_append(self): nrows = 100 - # Create a table without logging. + # Create a table. self.pr("create/populate table") uri = "table:rollback_to_stable14" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() # Pin oldest and stable to timestamp 10. diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable15.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable15.py index edc5ac31aba..d744a74c2ab 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable15.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable15.py @@ -55,8 +55,6 @@ class test_rollback_to_stable15(wttest.WiredTigerTestCase): config = 'cache_size=200MB,statistics=(all),debug_mode=(eviction=false)' if self.in_memory: config += ',in_memory=true' - else: - config += ',in_memory=false' return config def check(self, check_value, uri, nrows, read_ts): @@ -75,10 +73,11 @@ class test_rollback_to_stable15(wttest.WiredTigerTestCase): self.assertEqual(count, nrows) def test_rollback_to_stable(self): - # Create a table. uri = "table:rollback_to_stable15" nrows = 2000 - create_params = 'log=(enabled=false),key_format={},value_format={}'.format(self.key_format, self.value_format) + + # Create a table. + create_params = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_params) cursor = self.session.open_cursor(uri) diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable16.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable16.py index 6c81785c0c9..58655925563 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable16.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable16.py @@ -125,7 +125,8 @@ class test_rollback_to_stable16(wttest.WiredTigerTestCase): else: values = [0x01, 0x02, 0x03, 0x04] - create_params = 'log=(enabled=false),key_format={},value_format={}'.format(self.key_format, self.value_format) + # Create a table. + create_params = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_params) # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable17.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable17.py index d7e8211e5ce..2ba1fea425f 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable17.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable17.py @@ -52,8 +52,6 @@ class test_rollback_to_stable17(wttest.WiredTigerTestCase): config = 'cache_size=200MB,statistics=(all)' if self.in_memory: config += ',in_memory=true' - else: - config += ',in_memory=false' return config def insert_update_data(self, uri, value, start_row, end_row, timestamp): @@ -89,8 +87,9 @@ class test_rollback_to_stable17(wttest.WiredTigerTestCase): else: values = ["aaaa", "bbbb", "cccc", "dddd"] - format = 'key_format={},value_format={}'.format(self.key_format, self.value_format) - self.session.create(uri, format + ',log=(enabled=false)') + # Create a table. + config = 'key_format={},value_format={}'.format(self.key_format, self.value_format) + self.session.create(uri, config) # Pin oldest and stable to timestamp 1. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1) + diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable18.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable18.py index 06bb15a4ecd..baea2e468b1 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable18.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable18.py @@ -54,18 +54,16 @@ class test_rollback_to_stable18(test_rollback_to_stable_base): scenarios = make_scenarios(format_values, prepare_values) def conn_config(self): - config = 'cache_size=50MB,in_memory=true,statistics=(all),log=(enabled=false),' \ + config = 'cache_size=50MB,in_memory=true,statistics=(all),' \ 'eviction_dirty_trigger=10,eviction_updates_trigger=10' return config def test_rollback_to_stable(self): nrows = 10000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable18" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py index ae94cadf164..8d5e08b1375 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py @@ -55,22 +55,18 @@ class test_rollback_to_stable19(test_rollback_to_stable_base): scenarios = make_scenarios(in_memory_values, format_values, restart_options) def conn_config(self): - config = 'cache_size=50MB,statistics=(all),log=(enabled=false),eviction_dirty_trigger=10,' \ + config = 'cache_size=50MB,statistics=(all),eviction_dirty_trigger=10,' \ 'eviction_updates_trigger=10' if self.in_memory: config += ',in_memory=true' - else: - config += ',in_memory=false' return config def test_rollback_to_stable_no_history(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable19" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': @@ -158,11 +154,9 @@ class test_rollback_to_stable19(test_rollback_to_stable_base): def test_rollback_to_stable_with_history(self): nrows = 1000 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable19" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py index ab64bd76684..ee15849cc5c 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py @@ -53,9 +53,7 @@ class test_rollback_to_stable20(test_rollback_to_stable_base): ntables = 100 create_params = 'key_format={},value_format={}'.format(self.key_format, self.value_format) uri = "table:rollback_to_stable20" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable21.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable21.py index a729357fd99..d9270a14ff5 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable21.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable21.py @@ -57,9 +57,7 @@ class test_rollback_to_stable21(test_rollback_to_stable_base): # Create a table without logging. uri = "table:rollback_to_stable21" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': @@ -124,9 +122,7 @@ class test_rollback_to_stable21(test_rollback_to_stable_base): # Create a table without logging. uri = "table:rollback_to_stable21" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': @@ -199,9 +195,7 @@ class test_rollback_to_stable21(test_rollback_to_stable_base): # Create a table without logging. uri = "table:rollback_to_stable21" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable22.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable22.py index 1613a1fb58b..02fc9cca4e7 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable22.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable22.py @@ -57,8 +57,7 @@ class test_rollback_to_stable22(test_rollback_to_stable_base): ds_list = list() for i in range(0, nds): uri = 'table:rollback_to_stable22_{}'.format(i) - ds = SimpleDataSet( - self, uri, 0, key_format='i', value_format='S', config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format='i', value_format='S') ds.populate() ds_list.append(ds) self.assertEqual(len(ds_list), nds) diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable23.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable23.py index 17aeda9e37c..d0d98d30a90 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable23.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable23.py @@ -74,9 +74,7 @@ class test_rollback_to_stable23(test_rollback_to_stable_base): # Create a table without logging. uri = "table:rollback_to_stable23" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() # Pin oldest and stable to timestamp 10. diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable24.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable24.py index ad3b85ba893..9376eaf2308 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable24.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable24.py @@ -72,8 +72,7 @@ class test_rollback_to_stable24(wttest.WiredTigerTestCase): def test_rollback_to_stable24(self): # Create a table without logging. uri = "table:rollback_to_stable24" - format = 'key_format={},value_format=S'.format(self.key_format) - self.session.create(uri, format + ', log=(enabled=false)') + self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format)) # Pin oldest timestamp to 10. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10)) diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py index d24b4db3077..897336f9e73 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py @@ -227,8 +227,7 @@ class test_rollback_to_stable25(wttest.WiredTigerTestCase): def test_rollback_to_stable25(self): # Create a table without logging. uri = "table:rollback_to_stable25" - format = 'key_format=r,value_format=S' - self.session.create(uri, format + ', log=(enabled=false)') + self.session.create(uri, 'key_format=r,value_format=S') # Pin oldest timestamp to 5. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5)) diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable26.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable26.py index 6be6628ecec..8d905560e03 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable26.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable26.py @@ -75,11 +75,9 @@ class test_rollback_to_stable26(test_rollback_to_stable_base): def test_rollback_to_stable(self): nrows = 10 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable26" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable27.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable27.py index 9a3ba74c672..48b1a4b46c0 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable27.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable27.py @@ -52,8 +52,7 @@ class test_rollback_to_stable27(test_rollback_to_stable_base): def conn_config(self): if self.in_memory: return 'in_memory=true' - else: - return 'in_memory=false' + return '' # Evict the page to force reconciliation. def evict(self, uri, key, check_value): @@ -68,10 +67,9 @@ class test_rollback_to_stable27(test_rollback_to_stable_base): def test_rollback_to_stable(self): nrows = 10 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable27" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format="S") ds.populate() value_a = "aaaaa" * 10 diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable28.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable28.py index fda11c9c63c..faeb49a4714 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable28.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable28.py @@ -40,12 +40,12 @@ from test_rollback_to_stable01 import test_rollback_to_stable_base # the proper write generation number and we don't end up reading stale # transaction ID's stored on the page. class test_rollback_to_stable28(test_rollback_to_stable_base): - conn_config = 'log=(enabled=true),statistics=(all)' + conn_config = 'statistics=(all)' # Recovery connection config: The debug mode is only effective on high cache pressure as WiredTiger can potentially decide # to do an update restore evict on a page when the cache pressure requirements are not met. # This means setting eviction target low and cache size low. conn_recon = ',eviction_updates_trigger=10,eviction_dirty_trigger=5,eviction_dirty_target=1,' \ - 'cache_size=1MB,debug_mode=(update_restore_evict=true),log=(recover=on)' + 'cache_size=1MB,debug_mode=(update_restore_evict=true)' # In principle this test should be run on VLCS and FLCS; but it doesn't run reliably, in that # while it always works in the sense of producing the right values, it doesn't always trigger @@ -93,7 +93,7 @@ class test_rollback_to_stable28(test_rollback_to_stable_base): # Create our table. ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.extraconfig) + config=self.extraconfig) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable29.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable29.py index 37719c7b67e..c6cecf3ae5d 100755 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable29.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable29.py @@ -35,7 +35,7 @@ from test_rollback_to_stable01 import test_rollback_to_stable_base # test_rollback_to_stable29.py # Test that the rollback to stable to verify the history store order when an out of order to a tombstone. class test_rollback_to_stable29(test_rollback_to_stable_base): - conn_config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true)' + conn_config = 'cache_size=25MB,statistics=(all),statistics_log=(json,on_close,wait=1)' format_values = [ ('column', dict(key_format='r', value_format='S')), @@ -61,8 +61,7 @@ class test_rollback_to_stable29(test_rollback_to_stable_base): value_d = 'd' * 100 # Create our table. - ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() # Pin oldest and stable to timestamp 1. diff --git a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable31.py b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable31.py index 926a58dae91..6c7b3570aca 100644 --- a/src/third_party/wiredtiger/test/suite/test_rollback_to_stable31.py +++ b/src/third_party/wiredtiger/test/suite/test_rollback_to_stable31.py @@ -55,11 +55,9 @@ class test_rollback_to_stable31(test_rollback_to_stable_base): def test_rollback_to_stable(self): nrows = 10 - # Create a table without logging. + # Create a table. uri = "table:rollback_to_stable31" - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp02.py b/src/third_party/wiredtiger/test/suite/test_timestamp02.py index 8a0496b1888..5982db45abe 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp02.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp02.py @@ -46,8 +46,6 @@ class test_timestamp02(wttest.WiredTigerTestCase, suite_subprocess): ('row', dict(extra_config='')), ]) - conn_config = 'log=(enabled)' - # Check that a cursor (optionally started in a new transaction), sees the # expected values. def check(self, session, txn_config, expected): diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp03.py b/src/third_party/wiredtiger/test/suite/test_timestamp03.py index 32c47fe8730..4447283fc02 100755 --- a/src/third_party/wiredtiger/test/suite/test_timestamp03.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp03.py @@ -42,28 +42,14 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): table_nots_log = 'ts03_nots_logged' table_nots_nolog = 'ts03_nots_nologged' - # XXX neither the use_cg nor the use_index values are actually used. - # I've commented out the entries that are therefore duplicates; if/when that's fixed, put - # them back I guess. types = [ - ('file-row', dict(uri='file:', key_format='i', value_format='S', - use_cg=False, use_index=False)), - ('file-col', dict(uri='file:', key_format='r', value_format='S', - use_cg=False, use_index=False)), - ('file-col-fix', dict(uri='file:', key_format='r', value_format='8t', - use_cg=False, use_index=False)), - ('lsm', dict(uri='lsm:', key_format='i', value_format='S', - use_cg=False, use_index=False)), - ('table-row', dict(uri='table:', key_format='i', value_format='S', - use_cg=False, use_index=False)), - #('table-row-index', dict(uri='table:', key_format='i', value_format='S', - # use_cg=False, use_index=True)), - ('table-col', dict(uri='table:', key_format='r', value_format='S', - use_cg=False, use_index=False)), - ('table-col-fix', dict(uri='table:', key_format='r', value_format='8t', - use_cg=False, use_index=False)), - #('table-col-cg', dict(uri='table:', key_format='r', value_format='S', - # use_cg=True, use_index=False)), + ('file-row', dict(uri='file:', key_format='i', value_format='S')), + ('file-col', dict(uri='file:', key_format='r', value_format='S')), + ('file-col-fix', dict(uri='file:', key_format='r', value_format='8t')), + ('lsm', dict(uri='lsm:', key_format='i', value_format='S')), + ('table-row', dict(uri='table:', key_format='i', value_format='S')), + ('table-col', dict(uri='table:', key_format='r', value_format='S')), + ('table-col-fix', dict(uri='table:', key_format='r', value_format='8t')), ] ckpt = [ @@ -73,7 +59,6 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): ] conncfg = [ - ('nolog', dict(conn_config='create', using_log=False)), ('V1', dict(conn_config='create,log=(enabled,remove=false),compatibility=(release="2.9")', using_log=True)), ('V2', dict(conn_config='create,log=(enabled,remove=false)', using_log=True)), ] @@ -232,10 +217,10 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): # Scenario: 2 # Check that we see the inserted values as per the timestamp. for i, t in enumerate(orig_keys): - # Tables using the timestamps should see the values as per the - # given read_timestamp + # Tables using the timestamps should see the values as per the given read_timestamp. + # Logged tables don't use timestamps, so will always see the most recent value. self.check(self.session, 'read_timestamp=' + self.timestamp_str(t), - self.table_ts_log, dict((k, self.value) for k in orig_keys[:i+1])) + self.table_ts_log, dict((k, self.value) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + self.timestamp_str(t), self.table_ts_nolog, dict((k, self.value) for k in orig_keys[:i+1])) # Tables not using the timestamps should see all the values. @@ -284,7 +269,7 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): # with the read_timestamp as oldest_timestamp # Tables using the timestamps should see old values (i.e. value) only self.check(self.session, 'read_timestamp=' + old_ts, - self.table_ts_log, dict((k, self.value) for k in orig_keys)) + self.table_ts_log, dict((k, self.value2) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + old_ts, self.table_ts_nolog, dict((k, self.value) for k in orig_keys)) # Tables not using the timestamps should see updated values (i.e. value2). @@ -300,7 +285,7 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): earlier_ts = self.timestamp_str(90) self.check(self.session, 'read_timestamp=' + earlier_ts +',roundup_timestamps=(read=true)', - self.table_ts_log, dict((k, self.value) for k in orig_keys)) + self.table_ts_log, dict((k, self.value2) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + earlier_ts +',roundup_timestamps=(read=true)', self.table_ts_nolog, dict((k, self.value) for k in orig_keys)) @@ -321,12 +306,12 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): expected_dict[i+1] = self.value2 # Tables using the timestamps should see the updated values as per # the given read_timestamp + # Tables not using the timestamps should see all the data values as + # updated values (i.e. value2). self.check(self.session, 'read_timestamp=' + self.timestamp_str(t + 100), - self.table_ts_log, expected_dict) + self.table_ts_log, dict((k, self.value2) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + self.timestamp_str(t + 100), self.table_ts_nolog, expected_dict) - # Tables not using the timestamps should see all the data values as - # updated values (i.e. value2). self.check(self.session, 'read_timestamp=' + self.timestamp_str(t + 100), self.table_nots_log, dict((k, self.value2) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + self.timestamp_str(t + 100), @@ -340,18 +325,9 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): valcnt_ts_nolog = nkeys else: # Checkpoint will happen with stable_timestamp=100. - if self.using_log == True: - # only table_ts_nolog will have old values when logging is enabled - self.ckpt_backup(self.value, 0, nkeys, 0, 0) - else: - # Both table_ts_nolog and table_ts_log will have old values when - # logging is disabled. - self.ckpt_backup(self.value, nkeys, nkeys, 0, 0) - # table_ts_nolog will not have any new values (i.e. value2) - valcnt_ts_nolog = 0 + # only table_ts_log and table_ts_nolog will have old values when logging is enabled + self.ckpt_backup(self.value, 0, nkeys, 0, 0) - if self.ckpt_ts == False: - valcnt_ts_log = nkeys # Take a checkpoint using the given configuration. Then verify # whether value2 appears in a copy of that data or not. valcnt_ts_log = valcnt_nots_log = valcnt_nots_nolog = nkeys @@ -360,25 +336,16 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): valcnt_ts_nolog = nkeys else: # Checkpoint will happen with stable_timestamp=100. - if self.using_log == True: - # only table_ts_nolog will have old values when logging is enabled - self.ckpt_backup(self.value, 0, nkeys, 0, 0) - else: - # Both table_ts_nolog and table_ts_log will have old values when - # logging is disabled. - self.ckpt_backup(self.value, nkeys, nkeys, 0, 0) + # only table_ts_nolog will have old values when logging is enabled + self.ckpt_backup(self.value, 0, nkeys, 0, 0) # table_ts_nolog will not have any new values (i.e. value2) valcnt_ts_nolog = 0 if self.ckpt_ts == False: valcnt_ts_log = nkeys else: - # When log is enabled, table_ts_log will have all new values, else - # none. - if self.using_log == True: - valcnt_ts_log = nkeys - else: - valcnt_ts_log = 0 + # table_ts_log will have all new values + valcnt_ts_log = nkeys self.ckpt_backup(self.value2, valcnt_ts_log, valcnt_ts_nolog, valcnt_nots_log, valcnt_nots_nolog) @@ -389,10 +356,6 @@ class test_timestamp03(wttest.WiredTigerTestCase, suite_subprocess): self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(100+nkeys)) self.ckpt_backup(self.value2, nkeys, nkeys, nkeys, nkeys) - # If we're not using the log we're done. - if not self.using_log: - return - # Scenario: 7 # Update the keys and log_flush with out checkpoint. random.shuffle(keys) diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp06.py b/src/third_party/wiredtiger/test/suite/test_timestamp06.py index 056dafba81a..fe43dafb002 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp06.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp06.py @@ -53,9 +53,9 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): ] conncfg = [ - ('nolog', dict(conn_config='create', using_log=False)), - ('V1', dict(conn_config='create,log=(enabled,remove=false),compatibility=(release="2.9")', using_log=True)), - ('V2', dict(conn_config='create,log=(enabled,remove=false)', using_log=True)), + ('V1', + dict(conn_config='create,log=(enabled,remove=false),compatibility=(release="2.9")')), + ('V2', dict(conn_config='create,log=(enabled,remove=false)')), ] scenarios = make_scenarios(conncfg, types, ckpt) @@ -118,12 +118,13 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): self.backup_check(check_value, valcnt_ts_log, valcnt_ts_nolog) def test_timestamp06(self): - # Open two timestamp tables: - # 1. Table is logged and uses timestamps. + # Open two tables: + # 1. Table is logged and so timestamps are ignored. # 2. Table is not logged and uses timestamps. self.session.create(self.table_ts_log, 'key_format=i,value_format=i' + self.extra_config) cur_ts_log = self.session.open_cursor(self.table_ts_log) - self.session.create(self.table_ts_nolog, 'key_format=i,value_format=i,log=(enabled=false)' + self.extra_config) + self.session.create(self.table_ts_nolog, + 'key_format=i,value_format=i,log=(enabled=false)' + self.extra_config) cur_ts_nolog = self.session.open_cursor(self.table_ts_nolog) # Insert keys 1..100 @@ -154,17 +155,16 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): cur_ts_nolog.close() # Scenario: 1 - # Check that we see all the latest values (i.e. 3) as per transaction - # visibility when reading without the read timestamp. - # All tables should see all the values. + # Check that we see all the latest values (i.e. 3) as per transaction visibility when + # reading without the read timestamp. All tables should see all the values. self.check(self.session, "", self.table_ts_log, dict((k, 3) for k in orig_keys)) self.check(self.session, "", self.table_ts_nolog, dict((k, 3) for k in orig_keys)) # Scenario: 2 - # Check that we see the values till correctly from checkpointed data - # files in case of multistep transactions. + # Check that we see the values correctly from checkpointed data files in case of multistep + # transactions. # Set oldest and stable timestamps old_ts = self.timestamp_str(100) # Set the stable timestamp such that last update is beyond it. @@ -172,26 +172,18 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): self.conn.set_timestamp('oldest_timestamp=' + old_ts) self.conn.set_timestamp('stable_timestamp=' + stable_ts) - # Check that we see the values correctly till stable timestamp. + # Logged tables always see the latest value, non-logged tables should see values at the + # specified timestamp. self.check(self.session, 'read_timestamp=' + stable_ts, - self.table_ts_log, dict((k, 2) for k in orig_keys)) + self.table_ts_log, dict((k, 3) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + stable_ts, self.table_ts_nolog, dict((k, 2) for k in orig_keys)) - # For logged table we should see latest values (i.e. 3) when logging - # is enabled. - if self.using_log == True: - valcnt_ts_log = nkeys - else: - # When logging is disabled, we should not see the values beyond the - # stable timestamp with timestamped checkpoints. - if self.ckpt_ts == True: - valcnt_ts_log = 0 - else: - valcnt_ts_log = nkeys - - # For non-logged table we should not see the values beyond the - # stable timestamp with timestamped checkpoints. + # For logged table we should see latest values. + valcnt_ts_log = nkeys + + # For non-logged table we should not see the values beyond the stable timestamp with + # timestamped checkpoints. if self.ckpt_ts == True: valcnt_ts_nolog = 0 else: @@ -208,31 +200,19 @@ class test_timestamp06(wttest.WiredTigerTestCase, suite_subprocess): return self.conn.rollback_to_stable() - # All tables should see the values correctly when read with - # read timestamp as stable timestamp. + # Logged tables see the latest value, non-logged tables should see the values as of the + # specified timestamp. self.check(self.session, 'read_timestamp=' + stable_ts, - self.table_ts_nolog, dict((k, 2) for k in orig_keys)) + self.table_ts_log, dict((k, 3) for k in orig_keys)) self.check(self.session, 'read_timestamp=' + stable_ts, - self.table_ts_log, dict((k, 2) for k in orig_keys)) + self.table_ts_nolog, dict((k, 2) for k in orig_keys)) # Scenario: 4 - # Check that we see the values correctly when read without any - # timestamp. - if self.using_log == True: - # For logged table we should see latest values (i.e. 3) when logging - # is enabled. - self.check(self.session, "", - self.table_ts_log, dict((k, 3) for k in orig_keys)) - else: - # When logging is disabled, we should not see the values beyond the - # stable timestamp with timestamped checkpoints. - self.check(self.session, "", - self.table_ts_log, dict((k, 2) for k in orig_keys)) - - # For non-logged table we should not see the values beyond the + # Check that we see the values correctly when read without any timestamp. Logged tables + # always see the latest value, non-logged tables should not see the values beyond the # stable timestamp with timestamped checkpoints. - self.check(self.session, "", - self.table_ts_nolog, dict((k, 2) for k in orig_keys)) + self.check(self.session, "", self.table_ts_log, dict((k, 3) for k in orig_keys)) + self.check(self.session, "", self.table_ts_nolog, dict((k, 2) for k in orig_keys)) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp07.py b/src/third_party/wiredtiger/test/suite/test_timestamp07.py index 4964cb2a707..e3d494affec 100755 --- a/src/third_party/wiredtiger/test/suite/test_timestamp07.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp07.py @@ -39,12 +39,11 @@ from wtscenario import make_scenarios class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): tablename = 'ts07_ts_nologged' tablename2 = 'ts07_nots_logged' - tablename3 = 'ts07_ts_logged' format_values = [ - ('string-row', dict(key_format='i', value_format='S')), ('column', dict(key_format='r', value_format='S')), ('column-fix', dict(key_format='r', value_format='8t')), + ('row', dict(key_format='i', value_format='S')), ] types = [ @@ -53,8 +52,7 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): ] conncfg = [ - ('nolog', dict(conn_config='create,cache_size=2M', using_log=False)), - ('log', dict(conn_config='create,log=(enabled,file_max=1M,remove=false),cache_size=2M', using_log=True)), + ('log', dict(conn_config='create,log=(enabled,file_max=1M,remove=false),cache_size=2M')), ] nkeys = [ @@ -76,8 +74,8 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): self.value2 = u'\u0001\u0002dcba\u0007\u0004' self.value3 = u'\u0001\u0002cdef\u0007\u0004' - # Check that a cursor (optionally started in a new transaction), sees the - # expected value for a key + # Check that a cursor (optionally started in a new transaction), sees the expected value for a + # key. def check(self, session, txn_config, k, expected, flcs_expected): # In FLCS the table extends under uncommitted writes and we expect to # see zero rather than NOTFOUND. @@ -101,11 +99,9 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): session.begin_transaction(txn_config) c = session.open_cursor(self.uri + self.tablename, None) c2 = session.open_cursor(self.uri + self.tablename2, None) - c3 = session.open_cursor(self.uri + self.tablename3, None) - # In FLCS the values are bytes, which are numbers, but the tests below are via - # string inclusion rather than just equality of values. Not sure why that is, but - # I'm going to assume there's a reason for it and not change things. Compensate. + # In FLCS the values are bytes, which are numbers, but the tests below are via string + # inclusion rather than just equality of values. if self.value_format == '8t': check_value = str(check_value) @@ -119,21 +115,13 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): if check_value in str(v): count2 += 1 c2.close() - count3 = 0 - for k, v in c3: - if check_value in str(v): - count3 += 1 - c3.close() if txn_config: session.commit_transaction() self.assertEqual(count, valcnt) self.assertEqual(count2, valcnt2) - self.assertEqual(count3, valcnt3) - # - # Take a backup of the database and verify that the value we want to - # check exists in the tables the expected number of times. - # + # Take a backup of the database and verify that the value we want to check exists in the tables + # the expected number of times. def backup_check(self, check_value, valcnt, valcnt2, valcnt3): newdir = "BACKUP" copy_wiredtiger_home(self, '.', newdir, True) @@ -142,11 +130,9 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): session = self.setUpSessionOpen(conn) c = session.open_cursor(self.uri + self.tablename, None) c2 = session.open_cursor(self.uri + self.tablename2, None) - c3 = session.open_cursor(self.uri + self.tablename3, None) - # In FLCS the values are bytes, which are numbers, but the tests below are via - # string inclusion rather than just equality of values. Not sure why that is, but - # I'm going to assume there's a reason for it and not change things. Compensate. + # In FLCS the values are bytes, which are numbers, but the tests below are via string + # inclusion rather than just equality of values. if self.value_format == '8t': check_value = str(check_value) @@ -157,66 +143,51 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): # print "check_value found in key " + str(k) count += 1 c.close() - # Count how many times the second value is present in the - # non-timestamp table. + + # Count how many times the second value is present in the non-timestamp table. count2 = 0 for k, v in c2: if check_value in str(v): # print "check_value found in key " + str(k) count2 += 1 c2.close() - # Count how many times the second value is present in the - # logged timestamp table. - count3 = 0 - for k, v in c3: - if check_value in str(v): - count3 += 1 - c3.close() conn.close() - # print "CHECK BACKUP: Count " + str(count) + " Count2 " + str(count2) + " Count3 " + str(count3) + # print "CHECK BACKUP: Count " +\ + # str(count) + " Count2 " + str(count2) + " Count3 " + str(count3) # print "CHECK BACKUP: Expect value2 count " + str(valcnt) # print "CHECK BACKUP: 2nd table Expect value2 count " + str(valcnt2) # print "CHECK BACKUP: 3rd table Expect value2 count " + str(valcnt3) self.assertEqual(count, valcnt) self.assertEqual(count2, valcnt2) - self.assertEqual(count3, valcnt3) # Check that a cursor sees the expected values after a checkpoint. def ckpt_backup(self, check_value, valcnt, valcnt2, valcnt3): - # Take a checkpoint. Make a copy of the database. Open the - # copy and verify whether or not the expected data is in there. + # Take a checkpoint. Make a copy of the database. Open the copy and verify whether or not + # the expected data is in there. ckptcfg = 'use_timestamp=true' self.session.checkpoint(ckptcfg) self.backup_check(check_value, valcnt, valcnt2, valcnt3) def check_stable(self, check_value, valcnt, valcnt2, valcnt3): self.ckpt_backup(check_value, valcnt, valcnt2, valcnt3) - - # When reading as-of a timestamp, tables 1 and 3 should match (both - # use timestamps and we're not running recovery, so logging behavior - # should be irrelevant). self.check_reads(self.session, 'read_timestamp=' + self.stablets, check_value, valcnt, valcnt2, valcnt) def test_timestamp07(self): - uri = self.uri + self.tablename - uri2 = self.uri + self.tablename2 - uri3 = self.uri + self.tablename3 self.moreinit() - # - # Open three tables: + + # Open two tables: # 1. Table is not logged and uses timestamps. - # 2. Table is logged and does not use timestamps. - # 3. Table is logged and uses timestamps. + # 2. Table is logged and so timestamps are ignored. # format = 'key_format={},value_format={}'.format(self.key_format, self.value_format) + uri = self.uri + self.tablename self.session.create(uri, format + ',log=(enabled=false)') c = self.session.open_cursor(uri) + uri2 = self.uri + self.tablename2 self.session.create(uri2, format) c2 = self.session.open_cursor(uri2) - self.session.create(uri3, format) - c3 = self.session.open_cursor(uri3) # print "tables created" # Insert keys 1..nkeys each with timestamp=key, in some order. @@ -228,13 +199,11 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): c2[k] = self.value self.session.begin_transaction() c[k] = self.value - c3[k] = self.value self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(k)) # print "value inserted in all tables, reading..." - # Now check that we see the expected state when reading at each - # timestamp. + # Now check that we see the expected state when reading at each timestamp. for k in orig_keys: self.check(self.session, 'read_timestamp=' + self.timestamp_str(k), k, self.value, None) @@ -261,10 +230,9 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): # the last record written into the log. # # print "Key " + str(k) + " to value2" - c2[k] = self.value2 self.session.begin_transaction() c[k] = self.value2 - c3[k] = self.value2 + c2[k] = self.value2 ts = self.timestamp_str(k + self.nkeys) self.session.commit_transaction('commit_timestamp=' + ts) # print "Commit key " + str(k) + " ts " + ts @@ -272,10 +240,10 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): # print "Updated " + str(count) + " keys to value2" - # Take a checkpoint using the given configuration. Then verify - # whether value2 appears in a copy of that data or not. + # Take a checkpoint using the given configuration. Then verify the value doesn't appear + # in that copy of that data. # print "check_stable 1" - self.check_stable(self.value2, 0, self.nkeys, self.nkeys if self.using_log else 0) + self.check_stable(self.value2, 0, self.nkeys, 0) # Update the stable timestamp to the latest, but not the oldest # timestamp and make sure we can see the data. Once the stable @@ -285,10 +253,6 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): # print "check_stable 2" self.check_stable(self.value2, self.nkeys, self.nkeys, self.nkeys) - # If we're not using the log we're done. - if not self.using_log: - return - # Update the key and retry. This time take a backup and recover. random.shuffle(keys) count = 0 @@ -298,10 +262,9 @@ class test_timestamp07(wttest.WiredTigerTestCase, suite_subprocess): # the last record written into the log. # # print "Key " + str(k) + " to value3" - c2[k] = self.value3 self.session.begin_transaction() c[k] = self.value3 - c3[k] = self.value3 + c2[k] = self.value3 ts = self.timestamp_str(k + self.nkeys*2) self.session.commit_transaction('commit_timestamp=' + ts) # print "Commit key " + str(k) + " ts " + ts diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp12.py b/src/third_party/wiredtiger/test/suite/test_timestamp12.py index adec986fd13..e44bc03eb03 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp12.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp12.py @@ -35,8 +35,8 @@ from wtscenario import make_scenarios class test_timestamp12(wttest.WiredTigerTestCase): conn_config = 'config_base=false,create,log=(enabled)' - coll_uri = 'table:collection12' - oplog_uri = 'table:oplog12' + ckpt_uri = 'table:ckpt_table' + logged_uri = 'table:logged_table' format_values = [ ('integer-row', dict(key_format='i', value_format='i')), @@ -50,33 +50,33 @@ class test_timestamp12(wttest.WiredTigerTestCase): ] scenarios = make_scenarios(format_values, closecfg) - def verify_expected(self, op_exp, coll_exp): - c_op = self.session.open_cursor(self.oplog_uri) - c_coll = self.session.open_cursor(self.coll_uri) - op_actual = dict((k, v) for k, v in c_op if v != 0) - coll_actual = dict((k, v) for k, v in c_coll if v != 0) + def verify_expected(self, logged_exp, ckpt_exp): + c_logged = self.session.open_cursor(self.logged_uri) + c_ckpt = self.session.open_cursor(self.ckpt_uri) + logged_actual = dict((k, v) for k, v in c_logged if v != 0) + ckpt_actual = dict((k, v) for k, v in c_ckpt if v != 0) #print "CHECK: Op Expected" - #print op_exp + #print logged_exp #print "CHECK: Op Actual" - #print op_actual - self.assertTrue(op_actual == op_exp) + #print logged_actual + self.assertTrue(logged_actual == logged_exp) #print "CHECK: Coll Expected" - #print coll_exp + #print ckpt_exp #print "CHECK: Coll Actual" - #print coll_actual - self.assertTrue(coll_actual == coll_exp) + #print ckpt_actual + self.assertTrue(ckpt_actual == ckpt_exp) def test_timestamp_recovery(self): # - # Create several collection-like tables that are checkpoint durability. - # Add data to each of them separately and checkpoint so that each one - # has a different stable timestamp. + # Create a collection-like table that is checkpoint durability (that is, logging has been + # turned off), and an oplog-like table that is commit-level durability. Add data to each + # of them separately and checkpoint so each one has a different stable timestamp. # basecfg = 'key_format={},value_format={}'.format(self.key_format, self.value_format) - self.session.create(self.oplog_uri, basecfg) - self.session.create(self.coll_uri, basecfg + ',log=(enabled=false)') - c_op = self.session.open_cursor(self.oplog_uri) - c_coll = self.session.open_cursor(self.coll_uri) + self.session.create(self.logged_uri, basecfg) + self.session.create(self.ckpt_uri, basecfg + ',log=(enabled=false)') + c_logged = self.session.open_cursor(self.logged_uri) + c_ckpt = self.session.open_cursor(self.ckpt_uri) # Begin by adding some data. nentries = 10 @@ -85,8 +85,8 @@ class test_timestamp12(wttest.WiredTigerTestCase): all_keys = range(1, nentries*2) for i in first_range: self.session.begin_transaction() - c_op[i] = 1 - c_coll[i] = 1 + c_logged[i] = 1 + c_ckpt[i] = 1 self.session.commit_transaction( 'commit_timestamp=' + self.timestamp_str(i)) # Set the oldest and stable timestamp to the end. @@ -96,8 +96,8 @@ class test_timestamp12(wttest.WiredTigerTestCase): # Add more data but don't advance the stable timestamp. for i in second_range: self.session.begin_transaction() - c_op[i] = 1 - c_coll[i] = 1 + c_logged[i] = 1 + c_ckpt[i] = 1 self.pr("i: " + str(i)) self.session.commit_transaction( 'commit_timestamp=' + self.timestamp_str(i)) @@ -108,13 +108,13 @@ class test_timestamp12(wttest.WiredTigerTestCase): self.open_conn() # Set up our expected data and verify after the reopen. - op_exp = dict((k, 1) for k in all_keys) + logged_exp = dict((k, 1) for k in all_keys) if self.all_expected == True: - coll_exp = dict((k, 1) for k in all_keys) + ckpt_exp = dict((k, 1) for k in all_keys) else: - coll_exp = dict((k, 1) for k in first_range) + ckpt_exp = dict((k, 1) for k in first_range) - self.verify_expected(op_exp, coll_exp) + self.verify_expected(logged_exp, ckpt_exp) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp13.py b/src/third_party/wiredtiger/test/suite/test_timestamp13.py index e8791ee0691..ae4898c75bb 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp13.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp13.py @@ -45,8 +45,6 @@ class test_timestamp13(wttest.WiredTigerTestCase, suite_subprocess): ('row', dict(extra_config='')), ]) - conn_config = 'log=(enabled)' - def test_degenerate_timestamps(self): self.session.create(self.uri, 'key_format=i,value_format=i' + self.extra_config) diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp19.py b/src/third_party/wiredtiger/test/suite/test_timestamp19.py index 8062197c6d2..f24c110dccd 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp19.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp19.py @@ -33,7 +33,7 @@ from wtdataset import SimpleDataSet from wtscenario import make_scenarios class test_timestamp19(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled)' + conn_config = 'cache_size=50MB' format_values = [ ('integer-row', dict(key_format='i', value_format='S')), @@ -56,8 +56,7 @@ class test_timestamp19(wttest.WiredTigerTestCase): create_params = 'key_format={},value_format={}'.format(self.key_format, self.value_format) self.session.create(uri, create_params) - ds = SimpleDataSet( - self, uri, 0, key_format=self.key_format, value_format="S", config='log=(enabled=false)') + ds = SimpleDataSet(self, uri, 0, key_format=self.key_format, value_format="S") ds.populate() nrows = 1000 diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp22.py b/src/third_party/wiredtiger/test/suite/test_timestamp22.py index 6547ec00f68..90223277191 100755 --- a/src/third_party/wiredtiger/test/suite/test_timestamp22.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp22.py @@ -395,8 +395,7 @@ class test_timestamp22(wttest.WiredTigerTestCase): # Create tables with no entries ds = SimpleDataSet( - self, self.uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, self.uri, 0, key_format=self.key_format, value_format=self.value_format) # We do a bunch of iterations, doing transactions, prepare, and global timestamp calls # with timestamps that are sometimes valid, sometimes not. We use the iteration number diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp23.py b/src/third_party/wiredtiger/test/suite/test_timestamp23.py index a366a4d844c..efac6d87445 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp23.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp23.py @@ -49,8 +49,7 @@ class test_timestamp23(wttest.WiredTigerTestCase): # Create a file that contains active history (content newer than the oldest timestamp). table_uri = 'table:timestamp23' ds = SimpleDataSet( - self, table_uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + self, table_uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() self.session.checkpoint() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp24.py b/src/third_party/wiredtiger/test/suite/test_timestamp24.py index cacbc7804a9..51dedead43e 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp24.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp24.py @@ -56,9 +56,8 @@ class test_timestamp24(wttest.WiredTigerTestCase): def test_timestamp(self): table_uri = 'table:timestamp24' - ds = SimpleDataSet( - self, table_uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)') + ds = SimpleDataSet(self, + table_uri, 0, key_format=self.key_format, value_format=self.value_format) ds.populate() self.session.checkpoint() diff --git a/src/third_party/wiredtiger/test/suite/test_truncate06.py b/src/third_party/wiredtiger/test/suite/test_truncate06.py index 34e5fb259d3..7578f9dbe3e 100644 --- a/src/third_party/wiredtiger/test/suite/test_truncate06.py +++ b/src/third_party/wiredtiger/test/suite/test_truncate06.py @@ -127,7 +127,7 @@ class test_truncate06(wttest.WiredTigerTestCase): table_uri = 'table:truncate06' ds = SimpleDataSet( self, table_uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.extraconfig) + config=self.extraconfig) ds.populate() self.session.checkpoint() diff --git a/src/third_party/wiredtiger/test/suite/test_truncate07.py b/src/third_party/wiredtiger/test/suite/test_truncate07.py index 556ef8dd1e1..0be2316123d 100644 --- a/src/third_party/wiredtiger/test/suite/test_truncate07.py +++ b/src/third_party/wiredtiger/test/suite/test_truncate07.py @@ -128,7 +128,7 @@ class test_truncate07(wttest.WiredTigerTestCase): uri = "table:truncate07" ds = SimpleDataSet( self, uri, 0, key_format=self.key_format, value_format=self.value_format, - config='log=(enabled=false)' + self.extraconfig) + config=self.extraconfig) ds.populate() if self.value_format == '8t': diff --git a/src/third_party/wiredtiger/test/suite/test_txn25.py b/src/third_party/wiredtiger/test/suite/test_txn25.py index 31e00d7479e..1f5b7521ac2 100644 --- a/src/third_party/wiredtiger/test/suite/test_txn25.py +++ b/src/third_party/wiredtiger/test/suite/test_txn25.py @@ -30,24 +30,24 @@ # Test the write generation mechanism to ensure that transaction ids get wiped between runs. # -import wiredtiger, wttest +import wttest from wtscenario import make_scenarios class test_txn25(wttest.WiredTigerTestCase): - conn_config = 'cache_size=50MB,log=(enabled)' - + base_config = 'create,cache_size=50MB' format_values = [ - ('string-row', dict(key_format='S', usestrings=True, value_format='S')), - ('column', dict(key_format='r', usestrings=False, value_format='S')), - ('column-fix', dict(key_format='r', usestrings=False, value_format='8t')), + ('fix', dict(key_format='r', usestrings=False, value_format='8t')), + ('row', dict(key_format='S', usestrings=True, value_format='S')), + ('var', dict(key_format='r', usestrings=False, value_format='S')), + ] + log_config = [ + ('logging', dict(conn_config=base_config + ',log=(enabled)')), + ('no-logging', dict(conn_config=base_config)), ] - scenarios = make_scenarios(format_values) + scenarios = make_scenarios(format_values, log_config) def getkey(self, i): - if self.usestrings: - return str(i) - else: - return i + return str(i) if self.usestrings else i def test_txn25(self): uri = 'file:test_txn25' @@ -88,14 +88,13 @@ class test_txn25(wttest.WiredTigerTestCase): cursor[self.getkey(i)] = value3 self.session.commit_transaction() + # Force pages to be written with transaction IDs. + self.session.checkpoint() + session2.rollback_transaction() - session2.close() - # Close and re-open the connection. - cursor.close() - self.conn.close() - self.conn = wiredtiger.wiredtiger_open(self.home, self.conn_config) - self.session = self.conn.open_session(self.session_config) + # Reopen the connection. + self.reopen_conn() # Now that we've reopened, check that we can view the latest data from the previous run. # |