diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-10-17 07:07:28 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-10-17 07:07:28 +0000 |
commit | 2aeef188e23b9caf4c3c4255e4c9f93921d702ac (patch) | |
tree | 680137ba6f876bf2b0b034affa3c376b22c82083 | |
parent | 13fbd6b8da7dbbcbc61ee0cbba1e90715ffb8420 (diff) | |
parent | d267fbe2f95d1fe215710ea2e8be3338e6caca43 (diff) | |
download | mongo-2aeef188e23b9caf4c3c4255e4c9f93921d702ac.tar.gz |
Merge branch 'develop' into compact
-rw-r--r-- | dist/s_string.ok | 1 | ||||
-rw-r--r-- | examples/c/ex_all.c | 2 | ||||
-rw-r--r-- | examples/c/ex_test_perf.c | 2 | ||||
-rw-r--r-- | src/cursor/cur_index.c | 4 | ||||
-rw-r--r-- | src/include/txn.i | 14 | ||||
-rw-r--r-- | src/lsm/lsm_tree.c | 13 | ||||
-rw-r--r-- | src/schema/schema_list.c | 1 | ||||
-rw-r--r-- | test/bloom/test_bloom.c | 2 | ||||
-rw-r--r-- | test/fops/t.c | 2 | ||||
-rw-r--r-- | test/thread/t.c | 2 |
10 files changed, 32 insertions, 11 deletions
diff --git a/dist/s_string.ok b/dist/s_string.ok index b3fc3df2b65..9abf8bf4d2b 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -201,7 +201,6 @@ Vv VxWorks WIREDTIGER WeakHashLen -WildTiger WinNT WiredTiger WiredTiger's diff --git a/examples/c/ex_all.c b/examples/c/ex_all.c index e855e08b251..99b2392a86e 100644 --- a/examples/c/ex_all.c +++ b/examples/c/ex_all.c @@ -895,6 +895,8 @@ main(void) const char *home = "WT_TEST"; ret = wiredtiger_open(home, NULL, "create,transactional", &conn); /*! [Open a connection] */ + + (void)conn->close(conn, NULL); } /*! [Get the WiredTiger library version #1] */ diff --git a/examples/c/ex_test_perf.c b/examples/c/ex_test_perf.c index e5d9c0b1541..74de4ef39b3 100644 --- a/examples/c/ex_test_perf.c +++ b/examples/c/ex_test_perf.c @@ -192,7 +192,9 @@ read_thread(void *arg) cursor->set_key(cursor, key_buf); cursor->search(cursor); } + session->close(session, NULL); + free(key_buf); return (arg); } diff --git a/src/cursor/cur_index.c b/src/cursor/cur_index.c index 39966177fda..1c4fd99e521 100644 --- a/src/cursor/cur_index.c +++ b/src/cursor/cur_index.c @@ -289,9 +289,9 @@ __curindex_close(WT_CURSOR *cursor) __wt_free(session, cindex->cg_cursors); if (cindex->key_plan != idx->key_plan) __wt_free(session, cindex->key_plan); - if (cindex->value_plan != idx->value_plan) - __wt_free(session, cindex->value_plan); if (cursor->value_format != cindex->table->value_format) + __wt_free(session, cursor->value_format); + if (cindex->value_plan != idx->value_plan) __wt_free(session, cindex->value_plan); WT_TRET(__wt_btcur_close(&cindex->cbt)); diff --git a/src/include/txn.i b/src/include/txn.i index ccf04831f14..0f0425a5961 100644 --- a/src/include/txn.i +++ b/src/include/txn.i @@ -100,8 +100,18 @@ __wt_txn_visible(WT_SESSION_IMPL *session, wt_txnid_t id) if (id == txn->id) return (1); - /* Read-uncommitted transactions see all other changes. */ - if (txn->isolation == TXN_ISO_READ_UNCOMMITTED) + /* + * Read-uncommitted transactions see all other changes. + * + * All metadata reads are at read-uncommitted isolation. That's + * because once a schema-level operation completes, subsequent + * operations must see the current version of checkpoint metadata, or + * they may try to read blocks that may have been freed from a file. + * Metadata updates use non-transactional techniques (such as the + * schema and metadata locks) to protect access to in-flight updates. + */ + if (txn->isolation == TXN_ISO_READ_UNCOMMITTED || + session->btree == session->metafile) return (1); /* diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c index 2be721349ea..87145d36b5f 100644 --- a/src/lsm/lsm_tree.c +++ b/src/lsm/lsm_tree.c @@ -24,9 +24,18 @@ __lsm_tree_discard(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) if (F_ISSET(lsm_tree, WT_LSM_TREE_OPEN)) TAILQ_REMOVE(&S2C(session)->lsmqh, lsm_tree, q); + __wt_free(session, lsm_tree->name); + __wt_free(session, lsm_tree->config); + __wt_free(session, lsm_tree->key_format); + __wt_free(session, lsm_tree->value_format); + __wt_free(session, lsm_tree->file_config); + + if (lsm_tree->rwlock != NULL) + __wt_rwlock_destroy(session, &lsm_tree->rwlock); + + __wt_free(session, lsm_tree->stats); __wt_spin_destroy(session, &lsm_tree->lock); - __wt_free(session, lsm_tree->name); for (i = 0; i < lsm_tree->nchunks; i++) { if ((chunk = lsm_tree->chunk[i]) == NULL) continue; @@ -46,8 +55,6 @@ __lsm_tree_discard(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) __wt_free(session, chunk); } __wt_free(session, lsm_tree->old_chunks); - __wt_free(session, lsm_tree->stats); - __wt_free(session, lsm_tree); } diff --git a/src/schema/schema_list.c b/src/schema/schema_list.c index 704ec92f3a2..4fc82e72480 100644 --- a/src/schema/schema_list.c +++ b/src/schema/schema_list.c @@ -96,6 +96,7 @@ __wt_schema_destroy_index(WT_SESSION_IMPL *session, WT_INDEX *idx) __wt_free(session, idx->name); __wt_free(session, idx->source); __wt_free(session, idx->config); + __wt_free(session, idx->key_format); __wt_free(session, idx->key_plan); __wt_free(session, idx->value_plan); __wt_free(session, idx->idxkey_format); diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c index a19e1613fa2..7c339916fcb 100644 --- a/test/bloom/test_bloom.c +++ b/test/bloom/test_bloom.c @@ -106,7 +106,7 @@ int setup(void) int ret; char config[512]; - (void)system("rm -f WildTiger WiredTiger.* *.bf"); + (void)system("rm -f WiredTiger* *.bf"); /* * This test doesn't test public Wired Tiger functionality, it still diff --git a/test/fops/t.c b/test/fops/t.c index 694554741ec..f697f7fe30e 100644 --- a/test/fops/t.c +++ b/test/fops/t.c @@ -150,7 +150,7 @@ wt_shutdown(void) static void shutdown(void) { - (void)system("rm -f WildTiger WiredTiger.* __wt*"); + (void)system("rm -f WiredTiger* __wt*"); } static int diff --git a/test/thread/t.c b/test/thread/t.c index 0f40e0424e4..9858ed08719 100644 --- a/test/thread/t.c +++ b/test/thread/t.c @@ -177,7 +177,7 @@ wt_shutdown(void) static void shutdown(void) { - (void)system("rm -f WildTiger WiredTiger.* __wt*"); + (void)system("rm -f WiredTiger.* __wt*"); } static int |