Don't use TIDs with high offset numbers in AO tables.
Change the mapping AO segfilenum+rownum to an ItemPointer, so that we avoid using ItemPointer.ip_posid values higher than 32768. Such offsets are impossible on heap tables, because you can't fit that many tuples on a page. In GiST, since PostgreSQL 9.1, we have taken advantage of that by using 0xfffe (65534) to mark special "invalid" GiST tuples. We can tolerate that, because those invalid tuples can only appear on internal pages, so they cannot be confused with AO TIDs, which only appear on leaf pages. But we will also use of those high values for other similar magic values, in later version of PostgreSQL, so it seems better to keep clear of them, even if we could make it work. To allow binary upgrades of indexes that already contain AO tids with high offsets, we still allow and handle those, too, in the code to fetch AO tuples. Also relax the sanity check in GiST code, to not confuse those high values with invalid tuples. Fixes https://github.com/greenplum-db/gpdb/issues/6227Reviewed-by: NAshwin Agrawal <aagrawal@pivotal.io>
Showing
想要评论请 注册 或 登录