summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/lsm/lsm_meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm/lsm_meta.c')
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_meta.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_meta.c b/src/third_party/wiredtiger/src/lsm/lsm_meta.c
index 1337335ff5b..88daca989a6 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_meta.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_meta.c
@@ -282,17 +282,13 @@ __lsm_meta_read_v1(
WT_ERR(__wt_config_getones(session, lsmconf, "chunks", &cv));
__wt_config_subinit(session, &lparser, &cv);
for (nchunks = 0; (ret = __wt_config_next(&lparser, &lk, &lv)) == 0;) {
- if (WT_STRING_MATCH("generation", lk.str, lk.len)) {
+ if (WT_STRING_MATCH("id", lk.str, lk.len)) {
WT_ERR(__wt_realloc_def(session,
&lsm_tree->chunk_alloc,
nchunks + 1, &lsm_tree->chunk));
WT_ERR(__wt_calloc_one(session, &chunk));
lsm_tree->chunk[nchunks++] = chunk;
- chunk->generation = (uint32_t)lv.val;
- } else if (WT_STRING_MATCH("id", lk.str, lk.len)) {
chunk->id = (uint32_t)lv.val;
- WT_ERR(__wt_lsm_tree_chunk_name(session, lsm_tree,
- chunk->id, chunk->generation, &chunk->uri));
F_SET(chunk, WT_LSM_CHUNK_ONDISK | WT_LSM_CHUNK_STABLE);
} else if (WT_STRING_MATCH("bloom", lk.str, lk.len)) {
WT_ERR(__wt_lsm_tree_bloom_name(
@@ -302,6 +298,14 @@ __lsm_meta_read_v1(
chunk->size = (uint64_t)lv.val;
} else if (WT_STRING_MATCH("count", lk.str, lk.len)) {
chunk->count = (uint64_t)lv.val;
+ } else if (WT_STRING_MATCH("generation", lk.str, lk.len)) {
+ chunk->generation = (uint32_t)lv.val;
+ /*
+ * Id appears first, but we need both id and generation
+ * to create the name.
+ */
+ WT_ERR(__wt_lsm_tree_chunk_name(session, lsm_tree,
+ chunk->id, chunk->generation, &chunk->uri));
}
}
WT_ERR_NOTFOUND_OK(ret);
@@ -481,14 +485,10 @@ __wt_lsm_meta_write(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree,
chunk = lsm_tree->chunk[i];
if (i > 0)
WT_ERR(__wt_buf_catfmt(session, buf, ","));
- /*
- * Note that we need the generation before the ID for custom
- * data sources, or the wrong URI will be generated.
- */
WT_ERR(__wt_buf_catfmt(
- session, buf, "generation=%" PRIu32, chunk->generation));
+ session, buf, "id=%" PRIu32, chunk->id));
WT_ERR(__wt_buf_catfmt(
- session, buf, ",id=%" PRIu32, chunk->id));
+ session, buf, ",generation=%" PRIu32, chunk->generation));
if (F_ISSET(chunk, WT_LSM_CHUNK_BLOOM))
WT_ERR(__wt_buf_catfmt(session, buf, ",bloom"));
if (chunk->size != 0)