summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/schema
diff options
context:
space:
mode:
authorRamon Fernandez <ramon@mongodb.com>2015-11-03 08:07:56 -0500
committerRamon Fernandez <ramon@mongodb.com>2015-11-03 08:07:56 -0500
commit0899ba98f6311df0db8499cc7e0d56f563daea5f (patch)
tree8f330ae3ab6051983f6ee9fad111282c1f40af65 /src/third_party/wiredtiger/src/schema
parent6262a4f016ebd159a83712d0d1b550af39212c3e (diff)
downloadmongo-0899ba98f6311df0db8499cc7e0d56f563daea5f.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.2.0-rc1-210-gf95877a.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/schema')
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_stat.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/src/schema/schema_stat.c b/src/third_party/wiredtiger/src/schema/schema_stat.c
index d14b81d389f..355abf8f343 100644
--- a/src/third_party/wiredtiger/src/schema/schema_stat.c
+++ b/src/third_party/wiredtiger/src/schema/schema_stat.c
@@ -90,18 +90,19 @@ __curstat_size_only(WT_SESSION_IMPL *session,
WT_ERR(__wt_buf_fmt(
session, &namebuf, "%s.wt", uri + strlen("table:")));
/*
- * Get the size of the underlying file. There is nothing stopping a
- * race with schema level table operations (for example drop) if there
- * is a race there will be an error message generated.
+ * Get the size of the underlying file. This will fail for anything
+ * other than simple tables (LSM for example) and will fail if there
+ * are concurrent schema level operations (for example drop). That is
+ * fine - failing here results in falling back to the slow path of
+ * opening the handle.
*/
- WT_ERR(__wt_filesize_name(session, namebuf.data, &filesize));
-
- /* Setup and populate the statistics structure */
- __wt_stat_dsrc_init_single(&cst->u.dsrc_stats);
- cst->u.dsrc_stats.block_size = filesize;
- __wt_curstat_dsrc_final(cst);
-
- *was_fast = true;
+ if (__wt_filesize_name(session, namebuf.data, &filesize) == 0) {
+ /* Setup and populate the statistics structure */
+ __wt_stat_dsrc_init_single(&cst->u.dsrc_stats);
+ cst->u.dsrc_stats.block_size = filesize;
+ __wt_curstat_dsrc_final(cst);
+ *was_fast = true;
+ }
err: __wt_free(session, tableconf);
__wt_buf_free(session, &namebuf);