page_cache: replace long mutex sleep with SeqWait

When calling into the page cache, it was possible to wait on a blocking
mutex, which can stall the async executor.

Replace that sleep with a SeqWait::wait_for(lsn).await so that the
executor can go on with other work while we wait.

Change walreceiver_works to an AtomicBool to avoid the awkwardness of
taking the lock, then dropping it while we call wait_for and then
acquiring it again to do real work.
This commit is contained in:
Eric Seppanen
2021-04-20 12:30:21 -07:00
parent 8060e17b50
commit 2cd730d31f
4 changed files with 41 additions and 52 deletions

1
Cargo.lock generated
View File

@@ -1339,6 +1339,7 @@ dependencies = [
"tokio-stream",
"tui",
"walkdir",
"zenith_utils",
]
[[package]]