diff options
author | Andrew Morton <andrew.morton@mongodb.com> | 2023-05-16 22:21:25 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-17 00:50:01 +0000 |
commit | 376eae9eefe9f752d8d9b5189528f1353c019e54 (patch) | |
tree | 8780daf7a9ebd0ed2e8c1b25bf81571b3bb89911 /src/third_party/wiredtiger/src/btree/bt_compact.c | |
parent | e94168acd89dba4faef5e43f970633a781e8cba2 (diff) | |
download | mongo-376eae9eefe9f752d8d9b5189528f1353c019e54.tar.gz |
Import wiredtiger: 04dcc362042b8cc35fdd8de8343be3a15d4fa47c from branch mongodb-master
ref: d310d6330e..04dcc36204
for: 7.1.0-rc0
WT-10898 Add assertions for owning a spinlock
Diffstat (limited to 'src/third_party/wiredtiger/src/btree/bt_compact.c')
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_compact.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/btree/bt_compact.c b/src/third_party/wiredtiger/src/btree/bt_compact.c index 894e49c45b4..6e5fcc78353 100644 --- a/src/third_party/wiredtiger/src/btree/bt_compact.c +++ b/src/third_party/wiredtiger/src/btree/bt_compact.c @@ -21,6 +21,8 @@ __compact_page_inmem_check_addrs(WT_SESSION_IMPL *session, WT_REF *ref, bool *sk WT_PAGE_MODIFY *mod; uint32_t i; + WT_ASSERT_SPINLOCK_OWNED(session, &S2BT(session)->flush_lock); + *skipp = true; /* Default skip. */ bm = S2BT(session)->bm; @@ -61,6 +63,8 @@ __compact_page_inmem(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) { *skipp = true; /* Default skip. */ + WT_ASSERT_SPINLOCK_OWNED(session, &S2BT(session)->flush_lock); + /* * Ignore dirty pages, checkpoint will likely write them. There are cases where checkpoint can * skip dirty pages: to avoid that, we could alter the transactional information of the page, @@ -99,6 +103,8 @@ __compact_page_replace_addr(WT_SESSION_IMPL *session, WT_REF *ref, WT_ADDR_COPY WT_CELL_UNPACK_ADDR unpack; WT_DECL_RET; + WT_ASSERT_SPINLOCK_OWNED(session, &S2BT(session)->flush_lock); + /* * If there's no address at all (the page has never been written), allocate a new WT_ADDR * structure, otherwise, the address has already been instantiated, replace the cookie. @@ -161,6 +167,8 @@ __compact_page(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) *skipp = true; /* Default skip. */ + WT_ASSERT_SPINLOCK_OWNED(session, &S2BT(session)->flush_lock); + /* Lock the WT_REF. */ WT_REF_LOCK(session, ref, &previous_state); |