Don't panic if we receive a duplicate WAL record.

This is currently happening sometimes. I'm not sure why, and that needs to
be investigated, but just shut up the panic for now.
This commit is contained in:
Heikki Linnakangas
2021-03-26 15:21:29 +02:00
committed by Stas Kelvich
parent a482c3256c
commit 95c1ef5bb7

View File

@@ -361,7 +361,10 @@ pub fn put_wal_record(tag: BufferTag, rec: WALRecord)
let oldentry = shared.pagecache.insert(key, Arc::new(entry));
PAGECACHE.num_entries.fetch_add(1, Ordering::Relaxed);
assert!(oldentry.is_none());
if !oldentry.is_none() {
error!("overwriting WAL record in page cache");
}
PAGECACHE.num_wal_records.fetch_add(1, Ordering::Relaxed);
}