diff options
author | Luke Chen <luke.chen@mongodb.com> | 2019-07-30 16:51:11 +1000 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2019-07-30 16:51:11 +1000 |
commit | 733307411b32cbc92c3e2703a017acb44b3cdbe8 (patch) | |
tree | 35d910fd48a6e3fa54dc83cf8f52c8d0894a500e /src/third_party | |
parent | 0d6d248c39a5b4e43eefc9320b5dec3229cfcfdb (diff) | |
download | mongo-733307411b32cbc92c3e2703a017acb44b3cdbe8.tar.gz |
Import wiredtiger: 1055c64267ae9ee9a1ef11a9826dd409259b13d2 from branch mongodb-4.4
ref: 836466fade..1055c64267
for: 4.3.1
WT-4909 Fix potential code caching/re-ordering issue in __search_insert_append
WT-4965 Disable problematic eviction during checkpoints
Diffstat (limited to 'src/third_party')
-rw-r--r-- | src/third_party/wiredtiger/import.data | 4 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_sync.c | 11 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/row_srch.c | 9 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index fbc03b4e86a..49e3237bd7b 100644 --- a/src/third_party/wiredtiger/import.data +++ b/src/third_party/wiredtiger/import.data @@ -1,6 +1,6 @@ { - "commit": "836466fade7ff00065bff23eea86c8c21b52b3da", + "commit": "1055c64267ae9ee9a1ef11a9826dd409259b13d2", "github": "wiredtiger/wiredtiger.git", "vendor": "wiredtiger", - "branch": "mongodb-4.2" + "branch": "mongodb-4.4" } diff --git a/src/third_party/wiredtiger/src/btree/bt_sync.c b/src/third_party/wiredtiger/src/btree/bt_sync.c index 4334b29c7e8..a7d34d49f84 100644 --- a/src/third_party/wiredtiger/src/btree/bt_sync.c +++ b/src/third_party/wiredtiger/src/btree/bt_sync.c @@ -321,10 +321,19 @@ __wt_sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) * cache clean but with history that cannot be * discarded), that is not wasted effort because * checkpoint doesn't need to write the page again. + * + * XXX Only attempt this eviction when there are no + * readers older than the checkpoint. Otherwise, a bug + * in eviction can mark the page clean and discard + * history, causing those reads to incorrectly see + * newer versions of data than they should. */ if (!WT_PAGE_IS_INTERNAL(page) && page->read_gen == WT_READGEN_WONT_NEED && - !tried_eviction) { + !tried_eviction && + (!F_ISSET(txn, WT_TXN_HAS_TS_READ) || + txn->read_timestamp == + conn->txn_global.pinned_timestamp)) { WT_ERR_BUSY_OK( __wt_page_release_evict(session, walk, 0)); walk = prev; diff --git a/src/third_party/wiredtiger/src/btree/row_srch.c b/src/third_party/wiredtiger/src/btree/row_srch.c index 8603d329c15..a01ef5a49a7 100644 --- a/src/third_party/wiredtiger/src/btree/row_srch.c +++ b/src/third_party/wiredtiger/src/btree/row_srch.c @@ -30,6 +30,15 @@ __search_insert_append(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, if ((ins = WT_SKIP_LAST(ins_head)) == NULL) return (0); + /* + * Since the head of the skip list doesn't get mutated within this + * function, the compiler may move this assignment above within the + * loop below if it needs to (and may read a different value on each + * loop due to other threads mutating the skip list). + * + * Place a read barrier here to avoid this issue. + */ + WT_READ_BARRIER(); key.data = WT_INSERT_KEY(ins); key.size = WT_INSERT_KEY_SIZE(ins); |