diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-09-24 14:52:50 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-09-24 14:52:50 +1000 |
commit | 272fb8c866610b03aaf0352f49102ef07cdab466 (patch) | |
tree | faccd0aff45a1a6212e98a014a95581731c63fc9 | |
parent | 7e769e35df25cb4597af963760f943ed1e441afb (diff) | |
download | mongo-272fb8c866610b03aaf0352f49102ef07cdab466.tar.gz |
Have LSM read from checkpoints. In corner cases, we may have an empty chunk that was never checkpointed. If so, fall back to the ordinary "current" version of that (empty) chunk.
-rw-r--r-- | src/lsm/lsm_cursor.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c index dfabacf3e7f..4294a97e35f 100644 --- a/src/lsm/lsm_cursor.c +++ b/src/lsm/lsm_cursor.c @@ -153,9 +153,20 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm) * Once all cursors switch, the in-memory tree can be evicted. */ chunk = lsm_tree->chunk[i]; - WT_ERR(__wt_curfile_open(session, + ret = __wt_curfile_open(session, chunk->uri, &clsm->iface, - F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) ? ckpt_cfg : NULL, cp)); + F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) ? ckpt_cfg : NULL, cp); + + /* + * XXX kludge: we may have an empty chunk where no checkpoint + * was written. If so, try to open the ordinary handle on that + * chunk instead. + */ + if (ret == WT_NOTFOUND && F_ISSET(chunk, WT_LSM_CHUNK_ONDISK)) + ret = __wt_curfile_open(session, + chunk->uri, &clsm->iface, NULL, cp); + WT_ERR(ret); + if (chunk->bloom_uri != NULL && !F_ISSET(clsm, WT_CLSM_MERGE)) WT_ERR(__wt_bloom_open(session, chunk->bloom_uri, lsm_tree->bloom_bit_count, |