From 0899ba98f6311df0db8499cc7e0d56f563daea5f Mon Sep 17 00:00:00 2001 From: Ramon Fernandez Date: Tue, 3 Nov 2015 08:07:56 -0500 Subject: Import wiredtiger-wiredtiger-mongodb-3.2.0-rc1-210-gf95877a.tar.gz from wiredtiger branch mongodb-3.2 --- .../wiredtiger/src/schema/schema_stat.c | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/third_party/wiredtiger/src/schema') 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); -- cgit v1.2.1