From 376eae9eefe9f752d8d9b5189528f1353c019e54 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 16 May 2023 22:21:25 +0000 Subject: Import wiredtiger: 04dcc362042b8cc35fdd8de8343be3a15d4fa47c from branch mongodb-master ref: d310d6330e..04dcc36204 for: 7.1.0-rc0 WT-10898 Add assertions for owning a spinlock --- src/third_party/wiredtiger/src/btree/bt_compact.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/third_party/wiredtiger/src/btree/bt_compact.c') 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); -- cgit v1.2.1