diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-03-01 16:33:28 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-03-01 06:03:15 +0000 |
commit | 6dcf69cdd37b7fd8cc86b6d5412ceab67bceddfe (patch) | |
tree | 7c1593caea8a43d0e43c994b9a7f64812ece5be6 /src/third_party/wiredtiger/src/os_posix | |
parent | f4054ff40c1c8309eefdbc87e84e8e8403e51281 (diff) | |
download | mongo-6dcf69cdd37b7fd8cc86b6d5412ceab67bceddfe.tar.gz |
Import wiredtiger: 9f6b212f1fe4a069ed18bf49ff237b31b2098c4c from branch mongodb-5.0
ref: 135a36dc0a..9f6b212f1f
for: 4.9.0
WT-6673 RTS fix inconsistent checkpoint by removing updates outside of the checkpoint snapshot
Diffstat (limited to 'src/third_party/wiredtiger/src/os_posix')
-rw-r--r-- | src/third_party/wiredtiger/src/os_posix/os_fs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/os_posix/os_fs.c b/src/third_party/wiredtiger/src/os_posix/os_fs.c index ede22518c26..a472273de48 100644 --- a/src/third_party/wiredtiger/src/os_posix/os_fs.c +++ b/src/third_party/wiredtiger/src/os_posix/os_fs.c @@ -748,7 +748,10 @@ __posix_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const cha f |= O_CLOEXEC; #endif WT_SYSCALL_RETRY(((pfh->fd = open(name, f, 0444)) == -1 ? -1 : 0), ret); - if (ret != 0) + /* Return error if the file not found during rollback to stable. */ + if (ret != 0 && F_ISSET(session, WT_SESSION_ROLLBACK_TO_STABLE)) + WT_ERR(__wt_errno()); + else if (ret != 0) WT_ERR_MSG(session, ret, "%s: handle-open: open-directory", name); WT_ERR(__posix_open_file_cloexec(session, pfh->fd, name)); goto directory_open; @@ -800,7 +803,10 @@ __posix_open_file(WT_FILE_SYSTEM *file_system, WT_SESSION *wt_session, const cha /* Create/Open the file. */ WT_SYSCALL_RETRY(((pfh->fd = open(name, f, mode)) == -1 ? -1 : 0), ret); - if (ret != 0) + /* Return error if the file not found during rollback to stable. */ + if (ret != 0 && F_ISSET(session, WT_SESSION_ROLLBACK_TO_STABLE)) + WT_ERR(ENOENT); + else if (ret != 0) WT_ERR_MSG(session, ret, pfh->direct_io ? "%s: handle-open: open: failed with direct I/O configured, some " "filesystem types do not support direct I/O" : |