diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/conn')
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_api.c | 28 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_dhandle.c | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c index 56b3febfeb1..462e096263e 100644 --- a/src/third_party/wiredtiger/src/conn/conn_api.c +++ b/src/third_party/wiredtiger/src/conn/conn_api.c @@ -1441,6 +1441,16 @@ __conn_config_file( err: WT_TRET(__wt_close(session, &fh)); + + /** + * Encountering an invalid configuration string from the base configuration file suggests + * that there is corruption present in the file. + */ + if (!is_user && ret == EINVAL) { + F_SET(S2C(session), WT_CONN_DATA_CORRUPTION); + return (WT_ERROR); + } + return (ret); } @@ -1641,6 +1651,20 @@ __conn_single(WT_SESSION_IMPL *session, const char *cfg[]) bytelock = false; ret = 0; } + + /** + * The WiredTiger lock file will not be created if the WiredTiger file does not exist in the + * directory, suggesting possible corruption if the WiredTiger file was deleted. Suggest running + * salvage. + */ + if (ret == ENOENT) { + WT_ERR(__wt_fs_exist(session, WT_WIREDTIGER, &exist)); + if (!exist) { + F_SET(conn, WT_CONN_DATA_CORRUPTION); + WT_ERR(WT_ERROR); + } + } + WT_ERR(ret); if (bytelock) { /* @@ -1683,6 +1707,10 @@ __conn_single(WT_SESSION_IMPL *session, const char *cfg[]) ret = 0; WT_ERR(ret); } else { + if (ret == ENOENT) { + F_SET(conn, WT_CONN_DATA_CORRUPTION); + WT_ERR(WT_ERROR); + } WT_ERR(ret); /* * Lock the WiredTiger file (for backward compatibility reasons as described above). diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c index cc7f37bc7f0..c947954e75c 100644 --- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c +++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c @@ -494,6 +494,11 @@ err: if (dhandle->type == WT_DHANDLE_TYPE_BTREE) __wt_evict_file_exclusive_off(session); + if (ret == ENOENT && F_ISSET(dhandle, WT_DHANDLE_IS_METADATA)) { + F_SET(S2C(session), WT_CONN_DATA_CORRUPTION); + return (WT_ERROR); + } + return (ret); } |