Previously i've reported BUG # 16620. But there is no answer on my new mails, so i have to open this new report.
Currently we have to restart postgresql 12.3 every 5-7 days to make it work properly on 5 terabyte cluster with ~ 50 databases. The problem is that autovacuum stops to process certain databases and cycles on the only one... Until we restart cluster.
There is a known problem (https://www.postgresql.org/message-id/CAMkU=1yE4YyCC00W_GcNoOZ4X2qxF7x5DUAR_kMt-Ta=YPyFPQ@mail.gmail.com) that looks something like this, but restarting the database should not fix it (or at least, not for long), and it should stop on its own once the one database being vacuumed for wraparound has finished doing so. Is it vacuuming the same table over and over again, or is finishing that table and moving to another in the same database, or what?