You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Set the metapage's pd_lower correctly in brin, gin, and spgist indexes.
Previously, these index types left the pd_lower field set to the defaultSizeOfPageHeaderData, which is really a lie because it ought to point pastwhatever space is being used for metadata. The coding accidentally failedto fail because we never told xlog.c that the metapage is of standardformat --- but that's not very good, because it impedes WAL consistencychecking, and in some cases prevents compression of full-page images.To fix, ensure that we set pd_lower correctly, not only when creating ametapage but whenever we write it out (these apparently redundant steps areneeded to cope with pg_upgrade'd indexes that don't yet contain the rightvalue). This allows telling xlog.c that the page is of standard format.The WAL consistency check mask functions are made to mask only if pd_lowerappears valid, which I think is likely unnecessary complication, sinceany metapage appearing in a v11 WAL stream should contain valid pd_lower.But it doesn't cost much to be paranoid.Amit Langote, reviewed by Michael Paquier and Amit KapilaDiscussion:https://postgr.es/m/0d273805-0e9e-ec1a-cb84-d4da400b8f85@lab.ntt.co.jp