[PATCH] Fix autovacuum freeze bug where weight can lower a table's freeze score
Thread notes
1 note#bug
hackorum-bot#bug
@global #bug
Hi hackers,
In the autovacuum freeze scores added by d7965d65fc5, raising a freeze
weight can make a table's score smaller instead of larger. When a table
gets old, its score is raised to a power to grow fast, but a larger weight
makes this start while the score is still below one, where a power makes it
smaller. So a bigger weight can push a table near wraparound down the list.
The safety net still works; only the order changes.
The attached patch raises the score to a power only when that makes it
bigger, with a test. New in v19, so no backport needed.
Thanks,
Shihao
Hi,
On Mon, Aug 31, 2026 at 8:57 PM shihao zhong <zhong950419@gmail.com> wrote:
Hi hackers,
In the autovacuum freeze scores added by d7965d65fc5, raising a freeze
weight can make a table's score smaller instead of larger. When a table
gets old, its score is raised to a power to grow fast, but a larger weight
makes this start while the score is still below one, where a power makes it
smaller. So a bigger weight can push a table near wraparound down the list.
The safety net still works; only the order changes.The attached patch raises the score to a power only when that makes it
bigger, with a test. New in v19, so no backport needed.
Thanks for reporting this. This is already being discussed here:
/messages/by-id/apWcbq91BAfhmsKU@nathan. The
TAP test case looks interesting and will definitely be useful. You may
want to propose it in that thread or here.
--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com
Thanks for reporting this. This is already being discussed here:
/messages/by-id/apWcbq91BAfhmsKU@nathan. The
TAP test case looks interesting and will definitely be useful. You may
want to propose it in that thread or here.
Hi Bharath,
Thanks for pointing that out, I had rebased my patch based on Nathan's patch
and responded in that thread.
Thanks,
Shihao