summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/schema/schema_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/schema/schema_stat.c')
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_stat.c26
1 files changed, 15 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 dba1dfe5f55..0b8c2c2951a 100644
--- a/src/third_party/wiredtiger/src/schema/schema_stat.c
+++ b/src/third_party/wiredtiger/src/schema/schema_stat.c
@@ -89,19 +89,23 @@ __curstat_size_only(WT_SESSION_IMPL *session,
/* Build up the file name from the table URI. */
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.
+ * !!! Deliberately discard the return code from a failed call - the
+ * error is flagged by not setting fast to true.
*/
- WT_ERR(__wt_filesize_name(session, namebuf.data, &filesize));
-
- /* Setup and populate the statistics structure */
- __wt_stat_init_dsrc_stats(&cst->u.dsrc_stats);
- WT_STAT_SET(&cst->u.dsrc_stats, block_size, filesize);
- __wt_curstat_dsrc_final(cst);
-
- *was_fast = true;
+ if (__wt_filesize_name(session, namebuf.data, true, &filesize) == 0) {
+ /* Setup and populate the statistics structure */
+ __wt_stat_init_dsrc_stats(&cst->u.dsrc_stats);
+ WT_STAT_SET(&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);