Enable autovacuum, but only for 'template0'.
Autovacuum has been completely disabled so far. In the upstream, even if you set autovacuum=off, it would still run, if necessary, to prevent XID wraparound, but in GPDB we would not launch it even for that. That is problematic for template0, and any other databases with datallowconn=false. If you cannot connect to a database, you cannot manually VACUUM it. Therefore, its datfrozenxid is never advanced. We had hacked our way through that by letting XID wraparound to happen for databases with datallowconn=false. The theory was that template0 - and hopefully any other such database! - was fully frozen, so there is no harm in letting XID counter to wrap around. However, you get trouble if you create a new database, using template0 as the template, around the time that XID wraparound for template0 is about to happen. The new database will inherit the datfrozenxid value, and because it will have datallowconn=true, the system will immediately shut down because now it looks like XID wraparound happened. To fix, re-enable autovacuum, in a very limited fashion. The autovacuum launcher is now started, but it will only perform anti-wraparound vacuums, and only on databases with datallowconn=false. This includes fixes for some garden-variety bugs that have been introduced to autovacuum, when merging with upstream, that have gone unnoticed because the code has been unused. Discussion: https://groups.google.com/a/greenplum.org/d/msg/gpdb-dev/gqordopb6Gg/-GHXSE4qBwAJ
Showing
想要评论请 注册 或 登录