From e3b2297d340a083be330b178d2f7ce2c3b3566f2 Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Tue, 11 Jan 2022 16:22:10 +1100 Subject: Import wiredtiger: 719945d56d3c7691106faaa8d31172df3f78b927 from branch mongodb-5.2 ref: 3eb27a0940..719945d56d for: 5.2.0-rc5 WT-8631 Use oldest_timestamp and stable_timestamp instead of oldest/stable --- src/third_party/wiredtiger/dist/api_data.py | 39 ++++++++-------- src/third_party/wiredtiger/import.data | 2 +- src/third_party/wiredtiger/src/config/config_def.c | 21 +++++---- .../wiredtiger/src/include/wiredtiger.in | 35 ++++++++------- .../wiredtiger/src/schema/schema_create.c | 3 +- src/third_party/wiredtiger/src/txn/txn_timestamp.c | 6 ++- .../wiredtiger/test/checkpoint/checkpointer.c | 2 +- .../test/csuite/wt6616_checkpoint_oldest_ts/main.c | 4 +- .../wt8246_compact_rts_data_correctness/main.c | 4 +- src/third_party/wiredtiger/test/format/util.c | 2 +- .../wiredtiger/test/suite/test_import05.py | 7 ++- .../wiredtiger/test/suite/test_timestamp02.py | 45 ++++++++++++------- .../wiredtiger/test/suite/test_timestamp09.py | 6 ++- .../wiredtiger/test/suite/test_timestamp14.py | 8 ++-- .../wiredtiger/test/suite/test_timestamp19.py | 9 ++-- .../wiredtiger/test/suite/test_timestamp22.py | 4 +- .../wiredtiger/test/suite/test_timestamp25.py | 52 ++++++++++++++++++++++ 17 files changed, 167 insertions(+), 82 deletions(-) create mode 100644 src/third_party/wiredtiger/test/suite/test_timestamp25.py diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py index f3d1c145e59..ab6656652ec 100644 --- a/src/third_party/wiredtiger/dist/api_data.py +++ b/src/third_party/wiredtiger/dist/api_data.py @@ -1411,12 +1411,13 @@ methods = { Config('import', '', r''' configure import of an existing object into the currently running database''', type='category', subconfig=[ - Config('compare_timestamp', 'oldest', r''' - Allow importing files with timestamps smaller or equal to the configured - global timestamps. Note that the history of the files are not imported - together and thus snapshot read of historical data will not work with the - option "stable"''', - choices=['oldest', 'stable']), + Config('compare_timestamp', 'oldest_timestamp', r''' + Allow importing files with timestamps smaller or equal to the configured global + timestamps. Note the history of the files are not imported together and thus snapshot + read of historical data will not work with the option "stable_timestamp". (The \c + oldest and \c stable arguments are deprecated short-hand for \c oldest_timestamp + and \c stable_timestamp, respectively.)''', + choices=['oldest', 'oldest_timestamp', 'stable', 'stable_timestamp']), Config('enabled', 'false', r''' whether to import the input URI from disk''', type='boolean'), @@ -1938,19 +1939,19 @@ methods = { 'WT_CONNECTION.query_timestamp' : Method([ Config('get', 'all_durable', r''' - specify which timestamp to query: - \c all_durable returns the largest timestamp such that all timestamps - up to that value have been made durable, \c last_checkpoint returns the - timestamp of the most recent stable checkpoint, \c oldest returns the - most recent \c oldest_timestamp set with WT_CONNECTION::set_timestamp, - \c oldest_reader returns the minimum of the read timestamps of all - active readers \c pinned returns the minimum of the \c oldest_timestamp - and the read timestamps of all active readers, \c recovery returns the - timestamp of the most recent stable checkpoint taken prior to a shutdown - and \c stable returns the most recent \c stable_timestamp set with - WT_CONNECTION::set_timestamp. See @ref transaction_timestamps''', - choices=['all_durable','last_checkpoint', - 'oldest','oldest_reader','pinned','recovery','stable']), + specify which timestamp to query: \c all_durable returns the largest timestamp such that + all timestamps up to that value have been made durable, \c last_checkpoint returns the + timestamp of the most recent stable checkpoint, \c oldest_timestamp returns the most + recent \c oldest_timestamp set with WT_CONNECTION::set_timestamp, \c oldest_reader + returns the minimum of the read timestamps of all active readers \c pinned returns + the minimum of the \c oldest_timestamp and the read timestamps of all active readers, + \c recovery returns the timestamp of the most recent stable checkpoint taken prior to a + shutdown and \c stable_timestamp returns the most recent \c stable_timestamp set with + WT_CONNECTION::set_timestamp. (The \c oldest and \c stable arguments are deprecated + short-hand for \c oldest_timestamp and \c stable_timestamp, respectively.) See @ref + transaction_timestamps''', + choices=['all_durable','last_checkpoint','oldest', + 'oldest_reader','oldest_timestamp','pinned','recovery','stable','stable_timestamp']), ]), 'WT_CONNECTION.set_timestamp' : Method([ diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 9cff9401cfd..313b27c0380 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-5.2", - "commit": "3eb27a0940672c1391d86eccf79c397fd35349ba" + "commit": "719945d56d3c7691106faaa8d31172df3f78b927" } diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c index c60f9be912e..4f8ffae0d47 100644 --- a/src/third_party/wiredtiger/src/config/config_def.c +++ b/src/third_party/wiredtiger/src/config/config_def.c @@ -34,7 +34,8 @@ static const WT_CONFIG_CHECK confchk_WT_CONNECTION_open_session[] = { static const WT_CONFIG_CHECK confchk_WT_CONNECTION_query_timestamp[] = { {"get", "string", NULL, "choices=[\"all_durable\",\"last_checkpoint\",\"oldest\"," - "\"oldest_reader\",\"pinned\",\"recovery\",\"stable\"]", + "\"oldest_reader\",\"oldest_timestamp\",\"pinned\",\"recovery\"," + "\"stable\",\"stable_timestamp\"]", NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}}; @@ -260,7 +261,10 @@ static const WT_CONFIG_CHECK confchk_WT_SESSION_create_encryption_subconfigs[] = {NULL, NULL, NULL, NULL, NULL, 0}}; static const WT_CONFIG_CHECK confchk_WT_SESSION_create_import_subconfigs[] = { - {"compare_timestamp", "string", NULL, "choices=[\"oldest\",\"stable\"]", NULL, 0}, + {"compare_timestamp", "string", NULL, + "choices=[\"oldest\",\"oldest_timestamp\",\"stable\"," + "\"stable_timestamp\"]", + NULL, 0}, {"enabled", "boolean", NULL, NULL, NULL, 0}, {"file_metadata", "string", NULL, NULL, NULL, 0}, {"repair", "boolean", NULL, NULL, NULL, 0}, {NULL, NULL, NULL, NULL, NULL, 0}}; @@ -1246,12 +1250,13 @@ static const WT_CONFIG_ENTRY config_entries[] = {{"WT_CONNECTION.add_collator", "collator=,columns=,dictionary=0,encryption=(keyid=,name=)," "exclusive=false,extractor=,format=btree,huffman_key=," "huffman_value=,ignore_in_memory_cache_size=false,immutable=false" - ",import=(compare_timestamp=oldest,enabled=false,file_metadata=," - "repair=false),internal_item_max=0,internal_key_max=0," - "internal_key_truncate=true,internal_page_max=4KB,key_format=u," - "key_gap=10,leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB," - "leaf_value_max=0,log=(enabled=true),lsm=(auto_throttle=true," - "bloom=true,bloom_bit_count=16,bloom_config=,bloom_hash_count=8," + ",import=(compare_timestamp=oldest_timestamp,enabled=false," + "file_metadata=,repair=false),internal_item_max=0," + "internal_key_max=0,internal_key_truncate=true," + "internal_page_max=4KB,key_format=u,key_gap=10,leaf_item_max=0," + "leaf_key_max=0,leaf_page_max=32KB,leaf_value_max=0," + "log=(enabled=true),lsm=(auto_throttle=true,bloom=true," + "bloom_bit_count=16,bloom_config=,bloom_hash_count=8," "bloom_oldest=false,chunk_count_limit=0,chunk_max=5GB," "chunk_size=10MB,merge_custom=(prefix=,start_generation=0," "suffix=),merge_max=15,merge_min=0),memory_page_image_max=0," diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in index b9d33094ad6..f3223141e77 100644 --- a/src/third_party/wiredtiger/src/include/wiredtiger.in +++ b/src/third_party/wiredtiger/src/include/wiredtiger.in @@ -1170,12 +1170,14 @@ struct __wt_session { * @config{import = (, configure import of an existing object into the currently running * database., a set of related configuration options defined below.} * @config{    compare_timestamp, Allow importing files with timestamps - * smaller or equal to the configured global timestamps. Note that the history of the files - * are not imported together and thus snapshot read of historical data will not work with - * the option "stable"., a string\, chosen from the following options: \c "oldest"\, \c - * "stable"; default \c oldest.} - * @config{    enabled, whether to import - * the input URI from disk., a boolean flag; default \c false.} + * smaller or equal to the configured global timestamps. Note the history of the files are + * not imported together and thus snapshot read of historical data will not work with the + * option "stable_timestamp". (The \c oldest and \c stable arguments are deprecated + * short-hand for \c oldest_timestamp and \c stable_timestamp\, respectively.)., a string\, + * chosen from the following options: \c "oldest"\, \c "oldest_timestamp"\, \c "stable"\, \c + * "stable_timestamp"; default \c oldest_timestamp.} + * @config{     + * enabled, whether to import the input URI from disk., a boolean flag; default \c false.} * @config{    file_metadata, the file configuration extracted from the * metadata of the export database., a string; default empty.} * @config{    repair, whether to reconstruct the metadata from the raw @@ -2442,15 +2444,18 @@ struct __wt_connection { * @configstart{WT_CONNECTION.query_timestamp, see dist/api_data.py} * @config{get, specify which timestamp to query: \c all_durable returns the largest * timestamp such that all timestamps up to that value have been made durable\, \c - * last_checkpoint returns the timestamp of the most recent stable checkpoint\, \c oldest - * returns the most recent \c oldest_timestamp set with WT_CONNECTION::set_timestamp\, \c - * oldest_reader returns the minimum of the read timestamps of all active readers \c pinned - * returns the minimum of the \c oldest_timestamp and the read timestamps of all active - * readers\, \c recovery returns the timestamp of the most recent stable checkpoint taken - * prior to a shutdown and \c stable returns the most recent \c stable_timestamp set with - * WT_CONNECTION::set_timestamp. See @ref transaction_timestamps., a string\, chosen from - * the following options: \c "all_durable"\, \c "last_checkpoint"\, \c "oldest"\, \c - * "oldest_reader"\, \c "pinned"\, \c "recovery"\, \c "stable"; default \c all_durable.} + * last_checkpoint returns the timestamp of the most recent stable checkpoint\, \c + * oldest_timestamp returns the most recent \c oldest_timestamp set with + * WT_CONNECTION::set_timestamp\, \c oldest_reader returns the minimum of the read + * timestamps of all active readers \c pinned returns the minimum of the \c oldest_timestamp + * and the read timestamps of all active readers\, \c recovery returns the timestamp of the + * most recent stable checkpoint taken prior to a shutdown and \c stable_timestamp returns + * the most recent \c stable_timestamp set with WT_CONNECTION::set_timestamp. (The \c + * oldest and \c stable arguments are deprecated short-hand for \c oldest_timestamp and \c + * stable_timestamp\, respectively.) See @ref transaction_timestamps., a string\, chosen + * from the following options: \c "all_durable"\, \c "last_checkpoint"\, \c "oldest"\, \c + * "oldest_reader"\, \c "oldest_timestamp"\, \c "pinned"\, \c "recovery"\, \c "stable"\, \c + * "stable_timestamp"; default \c all_durable.} * @configend * @errors * If there is no matching timestamp (e.g., if this method is called diff --git a/src/third_party/wiredtiger/src/schema/schema_create.c b/src/third_party/wiredtiger/src/schema/schema_create.c index 16c868ba390..bd1ec73b2fc 100644 --- a/src/third_party/wiredtiger/src/schema/schema_create.c +++ b/src/third_party/wiredtiger/src/schema/schema_create.c @@ -261,7 +261,8 @@ __create_file( if (import) { against_stable = __wt_config_getones(session, config, "import.compare_timestamp", &cval) == 0 && - WT_STRING_MATCH("stable", cval.str, cval.len); + (WT_STRING_MATCH("stable", cval.str, cval.len) || + WT_STRING_MATCH("stable_timestamp", cval.str, cval.len)); WT_ERR(__check_imported_ts(session, uri, fileconf, against_stable)); } } diff --git a/src/third_party/wiredtiger/src/txn/txn_timestamp.c b/src/third_party/wiredtiger/src/txn/txn_timestamp.c index 8b0d68774d1..75a9928ed0b 100644 --- a/src/third_party/wiredtiger/src/txn/txn_timestamp.c +++ b/src/third_party/wiredtiger/src/txn/txn_timestamp.c @@ -191,7 +191,8 @@ __txn_global_query_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, cons /* Read-only value forever. Make sure we don't used a cached version. */ WT_BARRIER(); ts = txn_global->last_ckpt_timestamp; - } else if (WT_STRING_MATCH("oldest", cval.str, cval.len)) { + } else if (WT_STRING_MATCH("oldest_timestamp", cval.str, cval.len) || + WT_STRING_MATCH("oldest", cval.str, cval.len)) { if (!txn_global->has_oldest_timestamp) return (WT_NOTFOUND); ts = txn_global->oldest_timestamp; @@ -203,7 +204,8 @@ __txn_global_query_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t *tsp, cons else if (WT_STRING_MATCH("recovery", cval.str, cval.len)) /* Read-only value forever. No lock needed. */ ts = txn_global->recovery_timestamp; - else if (WT_STRING_MATCH("stable", cval.str, cval.len)) { + else if (WT_STRING_MATCH("stable_timestamp", cval.str, cval.len) || + WT_STRING_MATCH("stable", cval.str, cval.len)) { if (!txn_global->has_stable_timestamp) return (WT_NOTFOUND); ts = txn_global->stable_timestamp; diff --git a/src/third_party/wiredtiger/test/checkpoint/checkpointer.c b/src/third_party/wiredtiger/test/checkpoint/checkpointer.c index e99efbd7af7..6d92908124a 100644 --- a/src/third_party/wiredtiger/test/checkpoint/checkpointer.c +++ b/src/third_party/wiredtiger/test/checkpoint/checkpointer.c @@ -195,7 +195,7 @@ real_checkpointer(void) return (log_print_err("verify_consistency (online)", ret, 1)); if (g.use_timestamps) { - testutil_check(g.conn->query_timestamp(g.conn, timestamp_buf, "get=stable")); + testutil_check(g.conn->query_timestamp(g.conn, timestamp_buf, "get=stable_timestamp")); testutil_timestamp_parse(timestamp_buf, &stable_ts); oldest_ts = g.ts_oldest; if (stable_ts <= oldest_ts) diff --git a/src/third_party/wiredtiger/test/csuite/wt6616_checkpoint_oldest_ts/main.c b/src/third_party/wiredtiger/test/csuite/wt6616_checkpoint_oldest_ts/main.c index 6e49a950eb1..8b7de98e653 100644 --- a/src/third_party/wiredtiger/test/csuite/wt6616_checkpoint_oldest_ts/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt6616_checkpoint_oldest_ts/main.c @@ -375,11 +375,11 @@ main(int argc, char *argv[]) testutil_check(conn->open_session(conn, NULL, NULL, &session)); /* Get the stable timestamp from the stable timestamp of the last successful checkpoint. */ - testutil_check(conn->query_timestamp(conn, ts_string, "get=stable")); + testutil_check(conn->query_timestamp(conn, ts_string, "get=stable_timestamp")); testutil_timestamp_parse(ts_string, &stable_ts); /* Get the oldest timestamp from the oldest timestamp of the last successful checkpoint. */ - testutil_check(conn->query_timestamp(conn, ts_string, "get=oldest")); + testutil_check(conn->query_timestamp(conn, ts_string, "get=oldest_timestamp")); testutil_timestamp_parse(ts_string, &oldest_ts); printf("Verify data from oldest timestamp %" PRIu64 " to stable timestamp %" PRIu64 "\n", diff --git a/src/third_party/wiredtiger/test/csuite/wt8246_compact_rts_data_correctness/main.c b/src/third_party/wiredtiger/test/csuite/wt8246_compact_rts_data_correctness/main.c index 812f3f7432b..d00ea9d4b7f 100644 --- a/src/third_party/wiredtiger/test/csuite/wt8246_compact_rts_data_correctness/main.c +++ b/src/third_party/wiredtiger/test/csuite/wt8246_compact_rts_data_correctness/main.c @@ -192,11 +192,11 @@ run_test(bool column_store, const char *uri, bool preserve) testutil_check(conn->open_session(conn, NULL, NULL, &session)); /* Get the stable timestamp from the stable timestamp of the last successful checkpoint. */ - testutil_check(conn->query_timestamp(conn, ts_string, "get=stable")); + testutil_check(conn->query_timestamp(conn, ts_string, "get=stable_timestamp")); testutil_timestamp_parse(ts_string, &stable_ts); /* Get the oldest timestamp from the oldest timestamp of the last successful checkpoint. */ - testutil_check(conn->query_timestamp(conn, ts_string, "get=oldest")); + testutil_check(conn->query_timestamp(conn, ts_string, "get=oldest_timestamp")); testutil_timestamp_parse(ts_string, &oldest_ts); /* diff --git a/src/third_party/wiredtiger/test/format/util.c b/src/third_party/wiredtiger/test/format/util.c index 45f4f809815..30f446da4e7 100644 --- a/src/third_party/wiredtiger/test/format/util.c +++ b/src/third_party/wiredtiger/test/format/util.c @@ -384,7 +384,7 @@ set_oldest_timestamp(void) conn = g.wts_conn; - if ((ret = conn->query_timestamp(conn, tsbuf, "get=oldest")) == 0) { + if ((ret = conn->query_timestamp(conn, tsbuf, "get=oldest_timestamp")) == 0) { testutil_timestamp_parse(tsbuf, &oldest_ts); g.timestamp = oldest_ts; testutil_check( diff --git a/src/third_party/wiredtiger/test/suite/test_import05.py b/src/third_party/wiredtiger/test/suite/test_import05.py index 2a2ea7f6979..edddad2c2a0 100644 --- a/src/third_party/wiredtiger/test/suite/test_import05.py +++ b/src/third_party/wiredtiger/test/suite/test_import05.py @@ -107,12 +107,12 @@ class test_import05(test_import_base): # Contruct the config string. if self.repair: if self.global_ts == 'stable': - import_config = 'import=(enabled,repair=true,compare_timestamp=stable)' + import_config = 'import=(enabled,repair=true,compare_timestamp=stable_timestamp)' else: import_config = 'import=(enabled,repair=true)' else: if self.global_ts == 'stable': - import_config = 'import=(enabled,repair=false,compare_timestamp=stable,file_metadata=(' + \ + import_config = 'import=(enabled,repair=false,compare_timestamp=stable_timestamp,file_metadata=(' + \ original_db_file_config + '))' else: import_config = 'import=(enabled,repair=false,file_metadata=(' + \ @@ -120,8 +120,7 @@ class test_import05(test_import_base): # Create error pattern. Depending on the situation, we substitute a different timestamp into # error message to check against. - error_pattern = \ - 'import found aggregated {} timestamp newer than the current' + error_pattern = 'import found aggregated {} timestamp newer than the current' # Now begin trying to import the file. # diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp02.py b/src/third_party/wiredtiger/test/suite/test_timestamp02.py index 0dc0ce3b7e0..cc2c7423576 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp02.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp02.py @@ -141,50 +141,65 @@ class test_timestamp02(wttest.WiredTigerTestCase, suite_subprocess): # not being being set ahead of the stable. # Confirm that the oldest and the stable timestamps are as expected - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(200)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(300)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(200)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(300)) # Any attempt to set the oldest or stable to a value older than the current is silently # ignored. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(200)) + self.assertTimestampsEqual\ + (self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(200)) self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(1)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(300)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(300)) # An error to set oldest ahead of stable. self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(301)), '/oldest timestamp \(0, 301\) must not be later than stable timestamp \(0, 300\)/') - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(200)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(200)) self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(201)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(201)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(201)) self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(301)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(301)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(301)) # If both the oldest and the stable are provided in the same call, the behavior should be # consistent with providing them individually. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1) + ',stable_timestamp=' + self.timestamp_str(1)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(201)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(301)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(201)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(301)) self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(202) + ',stable_timestamp=' + self.timestamp_str(1)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(202)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(301)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(202)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(301)) self.assertRaisesWithMessage(wiredtiger.WiredTigerError, lambda: self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(302) + ',stable_timestamp=' + self.timestamp_str(1)), '/oldest timestamp \(0, 302\) must not be later than stable timestamp \(0, 301\)/') - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(202)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(301)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(202)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(301)) self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(302) + ',stable_timestamp=' + self.timestamp_str(302)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(302)) - self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(302)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(302)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(302)) def test_read_your_writes(self): self.session.create(self.uri, diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp09.py b/src/third_party/wiredtiger/test/suite/test_timestamp09.py index 05aa86e9398..1a813c31ff5 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp09.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp09.py @@ -107,7 +107,8 @@ class test_timestamp09(wttest.WiredTigerTestCase, suite_subprocess): # Oldest timestamp is 3 at the moment, trying to set it to an earlier # timestamp is a no-op. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1)) - self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(3)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp('get=oldest_timestamp'), self.timestamp_str(3)) self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(3) + ',stable_timestamp=' + self.timestamp_str(3)) @@ -115,7 +116,8 @@ class test_timestamp09(wttest.WiredTigerTestCase, suite_subprocess): # Stable timestamp is 5 at the moment, trying to set it to an earlier # timestamp is a no-op. self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(4)) - self.assertTimestampsEqual(self.conn.query_timestamp('get=stable'), self.timestamp_str(5)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp('get=stable_timestamp'), self.timestamp_str(5)) self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5)) self.assertRaisesWithMessage(wiredtiger.WiredTigerError, diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp14.py b/src/third_party/wiredtiger/test/suite/test_timestamp14.py index 213b309c528..0d6f9c05a8e 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp14.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp14.py @@ -203,7 +203,7 @@ class test_timestamp14(wttest.WiredTigerTestCase, suite_subprocess): session1.create(pinned_oldest_uri, format) # Confirm no oldest timestamp exists. self.assertRaisesException(wiredtiger.WiredTigerError, - lambda: self.conn.query_timestamp('get=oldest')) + lambda: self.conn.query_timestamp('get=oldest_timestamp')) # Confirm no pinned timestamp exists. self.assertRaisesException(wiredtiger.WiredTigerError, @@ -217,7 +217,7 @@ class test_timestamp14(wttest.WiredTigerTestCase, suite_subprocess): # Confirm no oldest timestamp exists. self.assertRaisesException(wiredtiger.WiredTigerError, - lambda: self.conn.query_timestamp('get=oldest')) + lambda: self.conn.query_timestamp('get=oldest_timestamp')) # Confirm no pinned timestamp exists. self.assertRaisesException(wiredtiger.WiredTigerError, @@ -393,7 +393,7 @@ class test_timestamp14(wttest.WiredTigerTestCase, suite_subprocess): # Confirm all_durable is now equal to oldest. self.assertTimestampsEqual( self.conn.query_timestamp('get=all_durable'), - self.conn.query_timestamp('get=oldest')) + self.conn.query_timestamp('get=oldest_timestamp')) session2.commit_transaction() self.assertTimestampsEqual( @@ -404,7 +404,7 @@ class test_timestamp14(wttest.WiredTigerTestCase, suite_subprocess): # Pinned will now match oldest. self.assertTimestampsEqual( self.conn.query_timestamp('get=pinned'), - self.conn.query_timestamp('get=oldest')) + self.conn.query_timestamp('get=oldest_timestamp')) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp19.py b/src/third_party/wiredtiger/test/suite/test_timestamp19.py index 740fba4fdb2..a9ed894ae64 100644 --- a/src/third_party/wiredtiger/test/suite/test_timestamp19.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp19.py @@ -102,13 +102,16 @@ class test_timestamp19(wttest.WiredTigerTestCase): # The oldest timestamp on recovery is 40. Trying to set it earlier is a no-op. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10)) - self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(40)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp('get=oldest_timestamp'), self.timestamp_str(40)) # Move the oldest and stable timestamps to 70. self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(70) + ', stable_timestamp=' + self.timestamp_str(70)) - self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(70)) - self.assertTimestampsEqual(self.conn.query_timestamp('get=stable'), self.timestamp_str(70)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp('get=oldest_timestamp'), self.timestamp_str(70)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp('get=stable_timestamp'), self.timestamp_str(70)) if __name__ == '__main__': wttest.run() diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp22.py b/src/third_party/wiredtiger/test/suite/test_timestamp22.py index 7081cdb4d46..753aed00489 100755 --- a/src/third_party/wiredtiger/test/suite/test_timestamp22.py +++ b/src/third_party/wiredtiger/test/suite/test_timestamp22.py @@ -383,8 +383,8 @@ class test_timestamp22(wttest.WiredTigerTestCase): # Make sure the state of global timestamps is what we think. expect_query_oldest = self.timestamp_str(self.oldest_ts) expect_query_stable = self.timestamp_str(self.stable_ts) - query_oldest = self.conn.query_timestamp('get=oldest') - query_stable = self.conn.query_timestamp('get=stable') + query_oldest = self.conn.query_timestamp('get=oldest_timestamp') + query_stable = self.conn.query_timestamp('get=stable_timestamp') self.assertEquals(expect_query_oldest, query_oldest) self.assertEquals(expect_query_stable, query_stable) diff --git a/src/third_party/wiredtiger/test/suite/test_timestamp25.py b/src/third_party/wiredtiger/test/suite/test_timestamp25.py new file mode 100644 index 00000000000..044f21b4abd --- /dev/null +++ b/src/third_party/wiredtiger/test/suite/test_timestamp25.py @@ -0,0 +1,52 @@ +#!/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. +# +# test_timestamp25.py +# Timestamps: backward compatible oldest and stable names. +# + +import wiredtiger, wttest +from suite_subprocess import suite_subprocess + +class test_timestamp25(wttest.WiredTigerTestCase, suite_subprocess): + tablename = 'test_timestamp25' + uri = 'table:' + tablename + + def test_short_names(self): + self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(100)) + self.assertTimestampsEqual(self.conn.query_timestamp("get=oldest"), self.timestamp_str(100)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=oldest_timestamp"), self.timestamp_str(100)) + + self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(100)) + self.assertTimestampsEqual(self.conn.query_timestamp("get=stable"), self.timestamp_str(100)) + self.assertTimestampsEqual(\ + self.conn.query_timestamp("get=stable_timestamp"), self.timestamp_str(100)) + +if __name__ == '__main__': + wttest.run() -- cgit v1.2.1