Import wiredtiger: a300655f291261468d87ed8461494be5c78ddcdb from branch mongodb-8.2 (#41375)

Co-authored-by: wt-vendoring-bot <wt-vendoring-bot@mongodb.com>
GitOrigin-RevId: de69aae102b2c44e50e93773ed3f801322fca93b
This commit is contained in:
wt-vendoring-bot[bot] 2025-09-17 08:44:43 +10:00 committed by MongoDB Bot
parent a402b4d130
commit 627d3cecf7
5 changed files with 87 additions and 11 deletions

View File

@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger",
"branch": "mongodb-8.2",
"commit": "70797c57f32d1b30410d062aeecd8fd5982b3848"
"commit": "a300655f291261468d87ed8461494be5c78ddcdb"
}

View File

@ -336,9 +336,7 @@ __wt_blkcache_write(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_PAGE_BLOCK_META *
*/
if (btree->compressor == NULL || btree->compressor->compress == NULL || compressed)
ip = buf;
else if (buf->size < 2 * WT_BLOCK_COMPRESS_SKIP) {
/* FIXME-WT-14609: the heuristic in the condition above was added for deltas and is likely
* to need tweaking. */
else if (buf->size <= btree->allocsize) {
ip = buf;
WT_STAT_DSRC_INCR(session, compress_write_too_small);
} else {
@ -379,9 +377,7 @@ __wt_blkcache_write(WT_SESSION_IMPL *session, WT_ITEM *buf, WT_PAGE_BLOCK_META *
* output requires), it just means the uncompressed version is as good as it gets, and
* that's what we use.
*/
if (compression_failed || buf->size < 2 * WT_BLOCK_COMPRESS_SKIP) {
/* FIXME-WT-14609: the heuristic in the condition above was added for deltas and is
* likely to need tweaking. */
if (compression_failed || buf->size / btree->allocsize <= result_len / btree->allocsize) {
ip = buf;
WT_STAT_DSRC_INCR(session, compress_write_fail);
} else {

View File

@ -504,6 +504,9 @@ __checkpoint_cleanup_walk_btree(WT_SESSION_IMPL *session, WT_ITEM *uri)
if (btree->root.page == NULL)
goto err;
/* Ignore tables that are empty or is currently in a bulk-load phase. */
if (btree->original)
goto err;
/*
* FLCS pages cannot be discarded and must be rewritten as implicitly filling in missing chunks
* of FLCS namespace is problematic.

View File

@ -447,8 +447,8 @@ __rec_validate_upd_chain(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *
prev_upd->prepare_state == WT_PREPARE_INPROGRESS ||
prev_upd->start_ts == prev_upd->durable_ts || prev_upd->durable_ts >= upd->durable_ts,
"Durable timestamps cannot be out of order for prepared updates: prev_upd->start_ts=%s, "
"prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu16
", upd->durable_ts=%s, upd->flags=%" PRIu16,
"prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu8
", upd->durable_ts=%s, upd->flags=%" PRIu8,
__wt_timestamp_to_string(prev_upd->start_ts, ts_string[0]),
__wt_timestamp_to_string(prev_upd->durable_ts, ts_string[1]), prev_upd->flags,
__wt_timestamp_to_string(upd->durable_ts, ts_string[2]), upd->flags);
@ -495,7 +495,7 @@ __rec_validate_upd_chain(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *
prev_upd->start_ts == prev_upd->durable_ts ||
prev_upd->durable_ts >= vpack->tw.durable_stop_ts,
"Stop: Durable timestamps cannot be out of order for prepared updates: "
"prev_upd->start_ts=%s, prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu16
"prev_upd->start_ts=%s, prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu8
", vpack->tw.durable_stop_ts=%s",
__wt_timestamp_to_string(prev_upd->start_ts, ts_string[0]),
__wt_timestamp_to_string(prev_upd->durable_ts, ts_string[1]), prev_upd->flags,
@ -506,7 +506,7 @@ __rec_validate_upd_chain(WT_SESSION_IMPL *session, WTI_RECONCILE *r, WT_UPDATE *
prev_upd->start_ts == prev_upd->durable_ts ||
prev_upd->durable_ts >= vpack->tw.durable_start_ts,
"Start: Durable timestamps cannot be out of order for prepared updates: "
"prev_upd->start_ts=%s, prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu16
"prev_upd->start_ts=%s, prev_upd->durable_ts=%s, prev_upd->flags=%" PRIu8
", vpack->tw.durable_start_ts=%s",
__wt_timestamp_to_string(prev_upd->start_ts, ts_string[0]),
__wt_timestamp_to_string(prev_upd->durable_ts, ts_string[1]), prev_upd->flags,

View File

@ -0,0 +1,77 @@
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
from test_cc01 import test_cc_base
import wttest
# test_drop04.py
# Test dropping a collection on empty logged table. The python test reproduces the WT-15225 bug.
class test_drop04(test_cc_base):
conn_config = 'log=(enabled=true)'
uri = 'table:test_drop04'
def test_drop_after_bulk_load(self):
for i in range(100):
self.assertEqual(self.session.create(self.uri, 'key_format=i,value_format=S'), 0)
# Checkpoint the database and wait for the checkpoint cleanup.
self.wait_for_cc_to_run()
self.pr("Finished checkpoint {i}, performing drop...")
self.assertEqual(self.session.drop(self.uri, "force=false"), 0)
self.pr("Done.")
if __name__ == '__main__':
wttest.run()