diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm')
-rw-r--r-- | src/third_party/wiredtiger/src/lsm/lsm_cursor.c | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/lsm/lsm_stat.c | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/lsm/lsm_tree.c | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/lsm/lsm_work_unit.c | 3 |
4 files changed, 14 insertions, 0 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c index e2a2a6888e7..8c441fdca1e 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c @@ -436,6 +436,8 @@ __clsm_open_cursors(WT_CURSOR_LSM *clsm, bool update, u_int start_chunk, uint32_ locked = false; lsm_tree = clsm->lsm_tree; + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + /* * Ensure that any snapshot update has cursors on the right set of chunks to guarantee * visibility is correct. diff --git a/src/third_party/wiredtiger/src/lsm/lsm_stat.c b/src/third_party/wiredtiger/src/lsm/lsm_stat.c index 80924f8d6b1..7527fea15e2 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_stat.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_stat.c @@ -29,6 +29,8 @@ __curstat_lsm_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR_STAT *cs WT_CONFIG_BASE(session, WT_SESSION_open_cursor), "checkpoint=" WT_CHECKPOINT, NULL, NULL}; bool locked; + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + locked = false; WT_RET(__wt_lsm_tree_get(session, uri, false, &lsm_tree)); WT_ERR(__wt_scr_alloc(session, 0, &uribuf)); diff --git a/src/third_party/wiredtiger/src/lsm/lsm_tree.c b/src/third_party/wiredtiger/src/lsm/lsm_tree.c index 5cdb060aa1d..398f1cfbc20 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_tree.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_tree.c @@ -284,6 +284,8 @@ int __wt_lsm_tree_setup_chunk(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, WT_LSM_CHUNK *chunk) { WT_ASSERT(session, FLD_ISSET(session->lock_flags, WT_SESSION_LOCKED_SCHEMA)); + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + __wt_epoch(session, &chunk->create_time); WT_RET(__wt_spin_init(session, &chunk->timestamp_spinlock, "LSM chunk timestamp")); @@ -705,6 +707,8 @@ __wt_lsm_tree_switch(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) uint32_t chunks_moved, nchunks, new_id; bool first_switch; + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + __wt_lsm_tree_writelock(session, lsm_tree); nchunks = lsm_tree->nchunks; @@ -950,6 +954,9 @@ __wt_lsm_tree_truncate(WT_SESSION_IMPL *session, const char *name, const char *c WT_UNUSED(cfg); + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->checkpoint_lock); + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + chunk = NULL; WT_NOT_READ(locked, false); diff --git a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c index 4748e559575..eaaf452cc53 100644 --- a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c +++ b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c @@ -325,6 +325,9 @@ __lsm_checkpoint_chunk(WT_SESSION_IMPL *session) { WT_DECL_RET; + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->checkpoint_lock); + WT_ASSERT_SPINLOCK_OWNED(session, &S2C(session)->schema_lock); + /* * Turn on metadata tracking to ensure the checkpoint gets the necessary handle locks. */ |