Hi,
I Recently encountered a situation on the field in which the message
“could not truncate directory "pg_serial": apparent wraparound”
was logged even through there was no danger of wraparound. This
was on a brand new cluster and only took a few minutes to see
the message in the logs.
Reading on some history of this error message, it appears that there
was work done to improve SLRU truncation and associated wraparound
log messages [1]. The attached repro on master still shows that this message
can be logged incorrectly.
The repro runs updates with 90 threads in serializable mode and kicks
off a “long running” select on the same table in serializable mode.
As soon as the long running select commits, the next checkpoint fails
to truncate the SLRU and logs the error message.
Besides the confusing log message, there may also also be risk with
pg_serial getting unnecessarily bloated and depleting the disk space.
Is this a bug?
[1] https://www.postgresql.org/message-id/flat/20190202083822.GC32531%40gust.leadboat.com
Regards,
Sami Imseih
Amazon Web Services (AWS)