diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/block/block_ext.c')
-rw-r--r-- | src/third_party/wiredtiger/src/block/block_ext.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_ext.c b/src/third_party/wiredtiger/src/block/block_ext.c index 618add993cf..f7917a75845 100644 --- a/src/third_party/wiredtiger/src/block/block_ext.c +++ b/src/third_party/wiredtiger/src/block/block_ext.c @@ -503,6 +503,9 @@ __wt_block_alloc(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t *offp, wt_o WT_EXT *ext, **estack[WT_SKIP_MAXDEPTH]; WT_SIZE *szp, **sstack[WT_SKIP_MAXDEPTH]; + /* The live lock must be locked. */ + WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock); + /* If a sync is running, no other sessions can allocate blocks. */ WT_ASSERT(session, WT_SESSION_BTREE_SYNC_SAFE(session, S2BT(session))); @@ -628,6 +631,10 @@ __wt_block_off_free( { WT_DECL_RET; + /* The live lock must be locked, except for when we are running salvage. */ + if (!F_ISSET(S2BT(session), WT_BTREE_SALVAGE)) + WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock); + /* If a sync is running, no other sessions can free blocks. */ WT_ASSERT(session, WT_SESSION_BTREE_SYNC_SAFE(session, S2BT(session))); @@ -695,6 +702,8 @@ __wt_block_extlist_overlap(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_C { WT_EXT *alloc, *discard; + WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock); + alloc = ci->alloc.off[0]; discard = ci->discard.off[0]; @@ -730,6 +739,8 @@ __block_ext_overlap(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST *ael, WT_EXTLIST *avail, *el; wt_off_t off, size; + WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock); + avail = &block->live.ckpt_avail; /* @@ -904,6 +915,11 @@ __wt_block_extlist_merge(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_EXTLIST * WT_EXTLIST tmp; u_int i; + /* + * We should hold the live lock here when running on the live checkpoint. But there is no easy + * way to determine if the checkpoint is live so we cannot assert the locking here. + */ + __wt_verbose_debug2(session, WT_VERB_BLOCK, "merging %s into %s", a->name, b->name); /* |