mirror of
https://github.com/neondatabase/neon.git
synced 2026-07-03 12:10:36 +00:00
page_cache: in cfg(test), bail if writeback fails
Tests use an extremely small page cache. This is very likely to trigger the indefinitely retrying loop mentioned in the comment above the changed line. It's easier to debug the tests if we bail out and fail. I also tried panicking, but, that wasn't as helpful as bailing out, in my experience.
This commit is contained in:
@@ -799,8 +799,12 @@ impl PageCache {
|
||||
// a different victim. But if the problem persists, the page cache
|
||||
// could fill up with dirty pages that we cannot evict, and we will
|
||||
// loop retrying the writebacks indefinitely.
|
||||
error!("writeback of buffer {:?} failed: {}", old_key, err);
|
||||
continue;
|
||||
if cfg!(test) {
|
||||
anyhow::bail!("writeback of buffer {:?} failed: {}", old_key, err);
|
||||
} else {
|
||||
error!("writeback of buffer {:?} failed: {}", old_key, err);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user