Skip to content

Commit 353d9fe

Browse files
lukechEvergreen Agent
authored andcommitted
Import wiredtiger: 15b4ef65bcd4dac075a5aa3fd03f013abc11c21e from branch mongodb-4.6
ref: dbcb682272..15b4ef65bc for: 4.5.1 WT-6532 Consider update structure overhead in split length calculation WT-6615 Initialize last_upd where it is actually used WT-6623 Set the connection level file id in recovery file scan WT-6635 Disable mix and column filetype test
1 parent 424f566 commit 353d9fe

File tree

5 files changed

+44
-17
lines changed

5 files changed

+44
-17
lines changed

src/third_party/wiredtiger/import.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"vendor": "wiredtiger",
33
"github": "wiredtiger/wiredtiger.git",
44
"branch": "mongodb-4.6",
5-
"commit": "dbcb6822729ee16eceeee28a8be7ce7aac6d8835"
5+
"commit": "15b4ef65bcd4dac075a5aa3fd03f013abc11c21e"
66
}

src/third_party/wiredtiger/src/include/reconcile.i

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,12 @@ __wt_rec_need_split(WT_RECONCILE *r, size_t len)
217217
* updates) associated with the page. If there are barely any items on the page, then it's not
218218
* worth splitting. We also want to temper this effect to avoid in-memory updates from
219219
* dominating the calculation and causing excessive splitting. Therefore, we'll limit the impact
220-
* to a tenth of the cache usage occupied by those updates.
220+
* to a tenth of the cache usage occupied by those updates. For small updates the overhead of
221+
* the update structure could skew the calculation, so we subtract the overhead before
222+
* considering the cache usage by the updates.
221223
*/
222224
if (r->page->type == WT_PAGE_ROW_LEAF && page_items > WT_REC_SPLIT_MIN_ITEMS_USE_MEM)
223-
len += r->supd_memsize / 10;
225+
len += (r->supd_memsize - (r->supd_next * WT_UPDATE_SIZE)) / 10;
224226

225227
/* Check for the disk image crossing a boundary. */
226228
return (WT_CHECK_CROSSING_BND(r, len));

src/third_party/wiredtiger/src/reconcile/rec_visibility.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v
440440
}
441441

442442
WT_ASSERT(session, upd->next == NULL || upd->next->txnid != WT_TXN_ABORTED);
443-
if (upd->next == NULL)
444-
last_upd = upd;
445443
upd_select->upd = upd = upd->next;
446444

447445
/*
@@ -475,9 +473,26 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v
475473
/* The beginning of the validity window is the selected update's time point. */
476474
WT_TIME_WINDOW_SET_START(select_tw, upd);
477475
else if (select_tw->stop_ts != WT_TS_NONE || select_tw->stop_txn != WT_TXN_NONE) {
478-
/* If we only have a tombstone in the update list, we must have an ondisk value. */
479-
WT_ASSERT(session,
480-
vpack != NULL && tombstone != NULL && !vpack->tw.prepare && last_upd->next == NULL);
476+
/*
477+
* We only have a tombstone on the update list or all the updates are from the same
478+
* transaction.
479+
*/
480+
WT_ASSERT(session, tombstone != NULL);
481+
482+
/* We must have an ondisk value and it can't be a prepared update. */
483+
WT_ASSERT(session, vpack != NULL && vpack->type != WT_CELL_DEL && !vpack->tw.prepare);
484+
485+
/* Move the pointer to the last update on the update chain. */
486+
for (last_upd = tombstone; last_upd->next != NULL; last_upd = last_upd->next)
487+
/*
488+
* Tombstone is the only non-aborted update on the update chain or all the updates
489+
* are from the same transaction.
490+
*/
491+
WT_ASSERT(session,
492+
last_upd->next->txnid == WT_TXN_ABORTED ||
493+
(last_upd->next->txnid == tombstone->txnid &&
494+
last_upd->next->start_ts == tombstone->start_ts));
495+
481496
/*
482497
* It's possible to have a tombstone as the only update in the update list. If we
483498
* reconciled before with only a single update and then read the page back into cache,
@@ -507,6 +522,10 @@ __wt_rec_upd_select(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_INSERT *ins, v
507522
WT_TIME_WINDOW_SET_START(select_tw, last_upd->next);
508523
} else {
509524
/*
525+
* It's possible that onpage value is not appended if the tombstone becomes
526+
* globally visible because the oldest transaction id or the oldest timestamp is
527+
* moved concurrently.
528+
*
510529
* If the tombstone is aborted concurrently, we should still have appended the
511530
* onpage value.
512531
*/

src/third_party/wiredtiger/src/txn/txn_recover.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,13 @@ __recovery_file_scan(WT_RECOVERY *r)
558558
WT_RET(__recovery_setup_file(r, uri, config));
559559
}
560560
WT_RET_NOTFOUND_OK(ret);
561+
562+
/*
563+
* Set the connection level file id tracker, as such upon creation of a new file we'll begin
564+
* from the latest file id.
565+
*/
566+
S2C(r->session)->next_file_id = r->max_fileid;
567+
561568
return (0);
562569
}
563570

@@ -683,7 +690,6 @@ __wt_txn_recover(WT_SESSION_IMPL *session, const char *cfg[])
683690
* the files.
684691
*/
685692
metafile = &r.files[WT_METAFILE_ID];
686-
conn->next_file_id = r.max_fileid;
687693

688694
if (FLD_ISSET(conn->log_flags, WT_CONN_LOG_ENABLED) && WT_IS_MAX_LSN(&metafile->ckpt_lsn) &&
689695
!WT_IS_MAX_LSN(&r.max_ckpt_lsn))
@@ -814,8 +820,6 @@ __wt_txn_recover(WT_SESSION_IMPL *session, const char *cfg[])
814820
ret = 0;
815821
WT_ERR(ret);
816822

817-
conn->next_file_id = r.max_fileid;
818-
819823
done:
820824
WT_ERR(__recovery_set_checkpoint_timestamp(&r));
821825
WT_ERR(__recovery_set_oldest_timestamp(&r));

src/third_party/wiredtiger/test/evergreen.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,15 +1914,17 @@ tasks:
19141914
vars:
19151915
# Don't use diagnostic - this test looks for timing problems that are more likely to occur without it
19161916
posix_configure_flags: --enable-strict
1917-
- func: "checkpoint test"
1918-
vars:
1919-
checkpoint_args: -t m -n 1000000 -k 5000000 -C cache_size=100MB
1917+
# Temporarily disable mix and column file type
1918+
# FIXME after WT-6608
1919+
#- func: "checkpoint test"
1920+
# vars:
1921+
# checkpoint_args: -t m -n 1000000 -k 5000000 -C cache_size=100MB
1922+
#- func: "checkpoint test"
1923+
# vars:
1924+
# checkpoint_args: -t c -n 1000000 -k 5000000 -C cache_size=100MB
19201925
- func: "checkpoint test"
19211926
vars:
19221927
checkpoint_args: -t r -n 1000000 -k 5000000 -C cache_size=100MB
1923-
- func: "checkpoint test"
1924-
vars:
1925-
checkpoint_args: -t c -n 1000000 -k 5000000 -C cache_size=100MB
19261928

19271929
- name: coverage-report
19281930
commands:

0 commit comments

Comments
 (0)