Skip to content

Files

Latest commit

Dec 15, 2023
f400df2 · Dec 15, 2023

History

History
73 lines (44 loc) · 3.27 KB

20210727_02.md

File metadata and controls

73 lines (44 loc) · 3.27 KB

PostgreSQL patch: pg_resetxlog: add option -u to set oldest xid & use by pg_upgrade

作者

digoal

日期

2021-07-27

标签

PostgreSQL , pg_resetxlog


背景

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=74cf7d46a91d601e0f8d957a7edbaeeb7df83efc

解决大版本升级时oldest xid设置过渡问题, 导致需要scan all relation's
relfrozenxid so it can advance pg_control's oldest xid to be inside the
autovacuum_freeze_max_age range

pg_resetxlog: add option to set oldest xid & use by pg_upgrade    
    
author	Bruce Momjian <bruce@momjian.us>	    
Tue, 27 Jul 2021 02:38:15 +0000 (22:38 -0400)    
committer	Bruce Momjian <bruce@momjian.us>	    
Tue, 27 Jul 2021 02:38:15 +0000 (22:38 -0400)    
commit	74cf7d46a91d601e0f8d957a7edbaeeb7df83efc    
tree	d39d0b0cd9b4b817e7ab7be03082509aede1f95f	tree    
parent	24ba1a87e4056ec34c8a685633a1a14fb89e5700	commit | diff    
pg_resetxlog:  add option to set oldest xid & use by pg_upgrade    
    
Add pg_resetxlog -u option to set the oldest xid in pg_control.    
Previously -x set this value be -2 billion less than the -x value.    
However, this causes the server to immediately scan all relation's    
relfrozenxid so it can advance pg_control's oldest xid to be inside the    
autovacuum_freeze_max_age range, which is inefficient and might disrupt    
diagnostic recovery.  pg_upgrade will use this option to better create    
the new cluster to match the old cluster.    
    
Reported-by: Jason Harvey, Floris Van Nee    
Discussion: https://postgr.es/m/20190615183759.GB239428@rfd.leadboat.com, 87da83168c644fd9aae38f546cc70295@opammb0562.comp.optiver.com    
    
Author: Bertrand Drouvot    
    
Backpatch-through: 9.6    

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

digoal's wechat