summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/meta/meta_table.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-11-02 11:55:14 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-11-02 11:55:14 +1100
commitfb6ebe75207c3221314ed318595489a838ef1db0 (patch)
tree6b9b210b15f9b9685b9a5dd707001297127ee1d3 /src/third_party/wiredtiger/src/meta/meta_table.c
parent4fbfa13ec0f819080a35ed8b528a030797e483a6 (diff)
downloadmongo-fb6ebe75207c3221314ed318595489a838ef1db0.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.2.0-rc1-194-g0dc3f20.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/meta/meta_table.c')
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_table.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/meta/meta_table.c b/src/third_party/wiredtiger/src/meta/meta_table.c
index 0bab52b9d9c..e7074a9c1b5 100644
--- a/src/third_party/wiredtiger/src/meta/meta_table.c
+++ b/src/third_party/wiredtiger/src/meta/meta_table.c
@@ -151,8 +151,11 @@ __wt_metadata_update(
key, value, WT_META_TRACKING(session) ? "true" : "false",
__metadata_turtle(key) ? "" : "not "));
- if (__metadata_turtle(key))
- return (__wt_turtle_update(session, key, value));
+ if (__metadata_turtle(key)) {
+ WT_WITH_TURTLE_LOCK(session,
+ ret = __wt_turtle_update(session, key, value));
+ return (ret);
+ }
if (WT_META_TRACKING(session))
WT_RET(__wt_meta_track_update(session, key));
@@ -219,9 +222,20 @@ __wt_metadata_search(
if (__metadata_turtle(key))
return (__wt_turtle_read(session, key, valuep));
+ /*
+ * 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.
+ */
WT_RET(__wt_metadata_cursor(session, NULL, &cursor));
cursor->set_key(cursor, key);
- WT_ERR(cursor->search(cursor));
+ WT_WITH_TXN_ISOLATION(session, WT_ISO_READ_UNCOMMITTED,
+ ret = cursor->search(cursor));
+ WT_ERR(ret);
+
WT_ERR(cursor->get_value(cursor, &value));
WT_ERR(__wt_strdup(session, value, valuep));