diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-11-05 13:38:21 +1100 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-11-05 13:38:21 +1100 |
commit | dfd716ec5e97d70c3114550935a17bdc09b9290c (patch) | |
tree | 07f995bd8cfe86cc639df2e52e6807c682bf980c | |
parent | 0d8a9736bc458eb8b523ed5c50c63c4ddb1e6b4e (diff) | |
download | mongo-dfd716ec5e97d70c3114550935a17bdc09b9290c.tar.gz |
Import wiredtiger: d5414b45fb8c8bbaa5dfe80065f63e5bc275cb40 from branch mongodb-3.6
ref: 45b751a54f..d5414b45fb
for: 3.6.9
WT-4395 Seg fault walking corrupted log with log cursor
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/log/log.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 4e6e637f3b5..5ba1915278e 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -1,5 +1,5 @@ { - "commit": "45b751a54fb181d1995684f7c807bbbc142d3c90", + "commit": "d5414b45fb8c8bbaa5dfe80065f63e5bc275cb40", "github": "wiredtiger/wiredtiger.git", "vendor": "wiredtiger", "branch": "mongodb-3.6" diff --git a/src/third_party/wiredtiger/src/log/log.c b/src/third_party/wiredtiger/src/log/log.c index 9a5854c8195..24de8564a71 100644 --- a/src/third_party/wiredtiger/src/log/log.c +++ b/src/third_party/wiredtiger/src/log/log.c @@ -2501,6 +2501,8 @@ advance: * the first pass through recovery. In the second pass * where we truncate the log, this is where it should * end. + * Continue processing where possible, so remember any + * error returns, but don't skip to the error handler. */ if (log != NULL) log->trunc_lsn = rd_lsn; @@ -2537,7 +2539,7 @@ advance: * must be salvaged. */ need_salvage = true; - WT_ERR(__log_salvage_message(session, + WT_TRET(__log_salvage_message(session, log_fh->name, ", bad checksum", rd_lsn.l.offset)); } else { @@ -2546,11 +2548,11 @@ advance: * that the header is corrupt. Make a sanity * check of the log record header. */ - WT_ERR(__log_record_verify(session, log_fh, + WT_TRET(__log_record_verify(session, log_fh, rd_lsn.l.offset, logrec, &corrupt)); if (corrupt) { need_salvage = true; - WT_ERR(__log_salvage_message(session, + WT_TRET(__log_salvage_message(session, log_fh->name, "", rd_lsn.l.offset)); } } @@ -2603,7 +2605,8 @@ advance: __wt_verbose(session, WT_VERB_LOG, "End of recovery truncate end of log %" PRIu32 "/%" PRIu32, rd_lsn.l.file, rd_lsn.l.offset); - WT_ERR(__log_truncate(session, &rd_lsn, false, false)); + /* Preserve prior error and fall through to error handling. */ + WT_TRET(__log_truncate(session, &rd_lsn, false, false)); } err: WT_STAT_CONN_INCR(session, log_scans); @@ -2623,7 +2626,7 @@ err: WT_STAT_CONN_INCR(session, log_scans); * an error recovery is likely going to fail. Try to provide * a helpful failure message. */ - if (ret != 0 && firstrecord) { + if (ret != 0 && firstrecord && LF_ISSET(WT_LOGSCAN_RECOVER)) { __wt_errx(session, "WiredTiger is unable to read the recovery log."); __wt_errx(session, "This may be due to the log" |