summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/third_party/wiredtiger/dist/api_data.py2
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/config/config_def.c16
-rw-r--r--src/third_party/wiredtiger/src/include/tiered.h1
-rw-r--r--src/third_party/wiredtiger/src/tiered/tiered_handle.c17
-rwxr-xr-xsrc/third_party/wiredtiger/test/suite/test_tiered04.py9
6 files changed, 34 insertions, 13 deletions
diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py
index ffe26ac16bd..75d5a6dbe40 100644
--- a/src/third_party/wiredtiger/dist/api_data.py
+++ b/src/third_party/wiredtiger/dist/api_data.py
@@ -466,6 +466,8 @@ lsm_meta = file_config + lsm_config + [
tiered_meta = file_meta + tiered_config + [
Config('last', '0', r'''
the last allocated object ID'''),
+ Config('oldest', '1', r'''
+ the oldest allocated object ID'''),
Config('tiers', '', r'''
list of data sources to combine into a tiered storage structure''', type='list'),
]
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 6343c2fb15b..205008b12a5 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": "374c2c9308e5683e8794bde0cbbf33f717898551"
+ "commit": "622ec1dfde9f5bdc6bd5bb6865d6c64051cfb878"
}
diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c
index fbe1981fade..f3f2d628d6c 100644
--- a/src/third_party/wiredtiger/src/config/config_def.c
+++ b/src/third_party/wiredtiger/src/config/config_def.c
@@ -769,7 +769,7 @@ static const WT_CONFIG_CHECK confchk_tiered_meta[] = {
{"log", "category", NULL, NULL, confchk_WT_SESSION_create_log_subconfigs, 1},
{"memory_page_image_max", "int", NULL, "min=0", NULL, 0},
{"memory_page_max", "int", NULL, "min=512B,max=10TB", NULL, 0},
- {"os_cache_dirty_max", "int", NULL, "min=0", NULL, 0},
+ {"oldest", "string", NULL, NULL, NULL, 0}, {"os_cache_dirty_max", "int", NULL, "min=0", NULL, 0},
{"os_cache_max", "int", NULL, "min=0", NULL, 0},
{"prefix_compression", "boolean", NULL, NULL, NULL, 0},
{"prefix_compression_min", "int", NULL, "min=0", NULL, 0},
@@ -1432,14 +1432,14 @@ static const WT_CONFIG_ENTRY config_entries[] = {{"WT_CONNECTION.add_collator",
"internal_page_max=4KB,key_format=u,key_gap=10,last=0,"
"leaf_item_max=0,leaf_key_max=0,leaf_page_max=32KB,"
"leaf_value_max=0,log=(enabled=true),memory_page_image_max=0,"
- "memory_page_max=5MB,os_cache_dirty_max=0,os_cache_max=0,"
- "prefix_compression=false,prefix_compression_min=4,readonly=false"
- ",split_deepen_min_child=0,split_deepen_per_child=0,split_pct=90,"
- "tiered_object=false,tiered_storage=(auth_token=,bucket=,"
- "bucket_prefix=,cache_directory=,local_retention=300,name=,"
- "object_target_size=10M),tiers=,value_format=u,verbose=[],"
+ "memory_page_max=5MB,oldest=1,os_cache_dirty_max=0,os_cache_max=0"
+ ",prefix_compression=false,prefix_compression_min=4,"
+ "readonly=false,split_deepen_min_child=0,split_deepen_per_child=0"
+ ",split_pct=90,tiered_object=false,tiered_storage=(auth_token=,"
+ "bucket=,bucket_prefix=,cache_directory=,local_retention=300,"
+ "name=,object_target_size=10M),tiers=,value_format=u,verbose=[],"
"version=(major=0,minor=0),write_timestamp_usage=none",
- confchk_tiered_meta, 49},
+ confchk_tiered_meta, 50},
{"wiredtiger_open",
"block_cache=(blkcache_eviction_aggression=1800,"
"cache_on_checkpoint=true,cache_on_writes=true,enabled=false,"
diff --git a/src/third_party/wiredtiger/src/include/tiered.h b/src/third_party/wiredtiger/src/include/tiered.h
index 9758042daad..1fa146aba5c 100644
--- a/src/third_party/wiredtiger/src/include/tiered.h
+++ b/src/third_party/wiredtiger/src/include/tiered.h
@@ -127,6 +127,7 @@ struct __wt_tiered {
uint32_t current_id; /* Current object id number */
uint32_t next_id; /* Next object number */
+ uint32_t oldest_id; /* Oldest object id number */
/* AUTOMATIC FLAG VALUE GENERATION START 0 */
#define WT_TIERED_FLAG_UNUSED 0x1u
diff --git a/src/third_party/wiredtiger/src/tiered/tiered_handle.c b/src/third_party/wiredtiger/src/tiered/tiered_handle.c
index 5be43f315c6..4a44cd90443 100644
--- a/src/third_party/wiredtiger/src/tiered/tiered_handle.c
+++ b/src/third_party/wiredtiger/src/tiered/tiered_handle.c
@@ -301,7 +301,8 @@ __wt_tiered_set_metadata(WT_SESSION_IMPL *session, WT_TIERED *tiered, WT_ITEM *b
{
uint32_t i;
- WT_RET(__wt_buf_catfmt(session, buf, ",last=%" PRIu32 ",tiers=(", tiered->current_id));
+ WT_RET(__wt_buf_catfmt(session, buf, ",last=%" PRIu32 ",oldest=%" PRIu32 ",tiers=(",
+ tiered->current_id, tiered->oldest_id));
for (i = 0; i < WT_TIERED_MAX_TIERS; ++i) {
if (tiered->tiers[i].name == NULL) {
__wt_verbose(session, WT_VERB_TIERED, "TIER_SET_META: names[%" PRIu32 "] NULL", i);
@@ -543,8 +544,18 @@ __tiered_open(WT_SESSION_IMPL *session, const char *cfg[])
WT_ERR(__wt_config_getones(session, config, "last", &cval));
tiered->current_id = (uint32_t)cval.val;
tiered->next_id = tiered->current_id + 1;
- __wt_verbose(session, WT_VERB_TIERED, "TIERED_OPEN: current %d, next %d",
- (int)tiered->current_id, (int)tiered->next_id);
+ /*
+ * For now this is always one. When garbage collection gets implemented then it will be updated
+ * to reflect the first object number that exists. Knowing this information will be helpful for
+ * other tasks such as tiered backup.
+ */
+ WT_ERR(__wt_config_getones(session, config, "oldest", &cval));
+ tiered->oldest_id = (uint32_t)cval.val;
+ WT_ASSERT(session, tiered->oldest_id == 1);
+
+ __wt_verbose(session, WT_VERB_TIERED,
+ "TIERED_OPEN: current %" PRIu32 ", next %" PRIu32 ", oldest %" PRIu32, tiered->current_id,
+ tiered->next_id, tiered->oldest_id);
ret = __wt_config_getones(session, config, "tiers", &tierconf);
WT_ERR_NOTFOUND_OK(ret, true);
diff --git a/src/third_party/wiredtiger/test/suite/test_tiered04.py b/src/third_party/wiredtiger/test/suite/test_tiered04.py
index 05fbbc44a5e..03d28891b0f 100755
--- a/src/third_party/wiredtiger/test/suite/test_tiered04.py
+++ b/src/third_party/wiredtiger/test/suite/test_tiered04.py
@@ -181,9 +181,16 @@ class test_tiered04(wttest.WiredTigerTestCase):
obj = self.get_stat(stat.conn.tiered_object_size, None)
self.assertEqual(obj, self.object_sys_val)
- # As we flush each object, we are currently removing the file: object. So N + 1 exists.
+ # As we flush each object, the next object exists, so N + 1 flushes is the last
+ # object number that exists (as the file:).
+ last = 'last=' + str(flush + 1)
+ # For now all earlier objects exist. So it is always 1 until garbage collection
+ # starts removing them.
+ oldest = 'oldest=1'
fileuri = self.fileuri_base + str(flush + 1) + '.wtobj'
self.check_metadata(self.tiereduri, intl_page)
+ self.check_metadata(self.tiereduri, last)
+ self.check_metadata(self.tiereduri, oldest)
self.check_metadata(fileuri, intl_page)
self.check_metadata(self.objuri, intl_page)