summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/block_cache/block_chunkcache.c
diff options
context:
space:
mode:
authorAndrew Morton <andrew.morton@mongodb.com>2023-05-16 22:21:25 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-17 00:50:01 +0000
commit376eae9eefe9f752d8d9b5189528f1353c019e54 (patch)
tree8780daf7a9ebd0ed2e8c1b25bf81571b3bb89911 /src/third_party/wiredtiger/src/block_cache/block_chunkcache.c
parente94168acd89dba4faef5e43f970633a781e8cba2 (diff)
downloadmongo-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/block_cache/block_chunkcache.c')
-rw-r--r--src/third_party/wiredtiger/src/block_cache/block_chunkcache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/block_cache/block_chunkcache.c b/src/third_party/wiredtiger/src/block_cache/block_chunkcache.c
index a09aa682369..5f3d615071d 100644
--- a/src/third_party/wiredtiger/src/block_cache/block_chunkcache.c
+++ b/src/third_party/wiredtiger/src/block_cache/block_chunkcache.c
@@ -121,8 +121,7 @@ __chunkcache_alloc_chunk(WT_SESSION_IMPL *session, wt_off_t offset, WT_BLOCK *bl
hash = __wt_hash_city64((void *)hash_id, sizeof(WT_CHUNKCACHE_HASHID));
(*newchunk)->bucket_id = hash % chunkcache->hashtable_size;
- WT_ASSERT(
- session, __wt_spin_trylock(session, WT_BUCKET_LOCK(chunkcache, (*newchunk)->bucket_id)) != 0);
+ WT_ASSERT_SPINLOCK_OWNED(session, WT_BUCKET_LOCK(chunkcache, (*newchunk)->bucket_id));
if ((ret = __chunkcache_alloc(session, *newchunk)) != 0) {
__wt_free(session, *newchunk);
@@ -409,6 +408,8 @@ __wt_chunkcache_remove(
uint64_t bucket_id;
bool done;
+ WT_ASSERT_SPINLOCK_OWNED(session, &block->live_lock);
+
chunkcache = &S2C(session)->chunkcache;
already_removed = 0;
remains_to_remove = size;