diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-09-05 09:10:57 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-04 23:40:53 +0000 |
commit | 969ad09882052d9e07048d28cfdb8ebf1736daa6 (patch) | |
tree | 6adc7863f518a19efdb054f37aa623a3ed744a76 /src/third_party/wiredtiger/src/block/block_ext.c | |
parent | f3def0f3c2d3880bb313e6d2e9dd7f8184e801f6 (diff) | |
download | mongo-969ad09882052d9e07048d28cfdb8ebf1736daa6.tar.gz |
Import wiredtiger: c004346e10b186c1ecea4a1ee3186619666c9c17 from branch mongodb-master
ref: bb64c7cdca..c004346e10
for: 6.2.0-rc0
WT-7833 wt_btree_switch_object needs to coordinate with concurrent write requests to btree (#8044)
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_ext.c')
-rw-r--r-- | src/third_party/wiredtiger/src/block/block_ext.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_ext.c b/src/third_party/wiredtiger/src/block/block_ext.c index 3406f8526b2..a4451ea00e0 100644 --- a/src/third_party/wiredtiger/src/block/block_ext.c +++ b/src/third_party/wiredtiger/src/block/block_ext.c @@ -571,7 +571,15 @@ __wt_block_free(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, WT_RET(__wt_block_addr_unpack( session, block, addr, addr_size, &objectid, &offset, &size, &checksum)); - /* We can't reuse free space in an object. */ + /* + * Freeing blocks in a previous object isn't possible in the current architecture. We'd like to + * know when a previous object is either completely rewritten (or more likely, empty enough that + * rewriting remaining blocks is worth doing). Just knowing which blocks are no longer in use + * isn't enough to remove them (because the internal pages have to be rewritten and we don't + * know where they are); the simplest solution is probably to keep a count of freed bytes from + * each object in the metadata, and when enough of the object is no longer in use, perform a + * compaction like process to do any remaining cleanup. + */ if (objectid != block->objectid) return (0); |