Skip to content

Fix several bugs in cache_test#642

Merged
rtjohnso merged 1 commit intomainfrom
robj/cache_test-fixes
Jun 24, 2025
Merged

Fix several bugs in cache_test#642
rtjohnso merged 1 commit intomainfrom
robj/cache_test-fixes

Conversation

@rtjohnso
Copy link
Collaborator

test_wait_inflight did not match how it was used from test_do_read_batch.

Also, cache_assert_ungot was attempting to implement an impossible check and the test was attempting to use that check.

clockcache_assert_ungot was trying to check only that the current thread did not hold a read lock on the specificied page. But, since CC_RC_WIDTH is only 4, multiple threads may share the same read counter and hence, even if one thread holds no locks, the read counter for a page may be non-zero. So I changed clockcache_assert_ungot to check that no thread has a read lock on the page, which matches its description.

I then modified cache_test to use the corrected cache_assert_ungot.

@netlify
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for splinterdb canceled.

Name Link
🔨 Latest commit da800e9
🔍 Latest deploy log https://app.netlify.com/projects/splinterdb/deploys/685a52e0e5b55d0008e11b13

@rtjohnso
Copy link
Collaborator Author

Fixes #306 .

@rtjohnso rtjohnso enabled auto-merge (squash) June 24, 2025 07:26
@rtjohnso rtjohnso disabled auto-merge June 24, 2025 07:26
@rtjohnso rtjohnso enabled auto-merge (squash) June 24, 2025 07:26
@rtjohnso rtjohnso merged commit 4772b98 into main Jun 24, 2025
16 of 17 checks passed
@rtjohnso rtjohnso deleted the robj/cache_test-fixes branch June 24, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant