summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lsm/lsm_cursor.c3
-rw-r--r--src/lsm/lsm_tree.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c
index f619af0ef86..dfabacf3e7f 100644
--- a/src/lsm/lsm_cursor.c
+++ b/src/lsm/lsm_cursor.c
@@ -113,7 +113,8 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm)
WT_LSM_CHUNK *chunk;
WT_LSM_TREE *lsm_tree;
WT_SESSION_IMPL *session;
- const char *ckpt_cfg[] = { "checkpoint=WiredTigerCheckpoint", NULL };
+ const char *ckpt_cfg[] = API_CONF_DEFAULTS(session, open_cursor,
+ "checkpoint=WiredTigerCheckpoint");
int i, nchunks;
session = (WT_SESSION_IMPL *)clsm->iface.session;
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index 45e60621dd4..49ccdd07c4f 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -232,7 +232,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
lsm_tree->file_config = __wt_buf_steal(session, buf, NULL);
/* Create the first chunk and flush the metadata. */
- WT_ERR(__wt_lsm_tree_switch(session, lsm_tree));
+ WT_ERR(__wt_lsm_meta_write(session, lsm_tree));
/* Discard our partially populated handle. */
__lsm_tree_discard(session, lsm_tree);
@@ -273,6 +273,9 @@ __lsm_tree_open(
lsm_tree->filename = lsm_tree->name + strlen("lsm:");
WT_ERR(__wt_lsm_meta_read(session, lsm_tree));
+ if (lsm_tree->nchunks == 0)
+ WT_ERR(__wt_lsm_tree_switch(session, lsm_tree));
+
/* Set the generation number so cursors are opened on first usage. */
lsm_tree->dsk_gen = 1;