mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Use full 64-bit XID for checking if a deleted GiST page is old enough.
Otherwise, after a deleted page gets even older, it becomes unrecyclable again. B-tree has the same problem, and has had since time immemorial, but let's at least fix this in GiST, where this is new. Backpatch to v12, where GiST page deletion was introduced. Reviewed-by: Andrey Borodin Discussion: https://www.postgresql.org/message-id/835A15A5-F1B4-4446-A711-BF48357EB602%40yandex-team.ru
This commit is contained in:
@@ -26,10 +26,11 @@ out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
|
||||
static void
|
||||
out_gistxlogPageReuse(StringInfo buf, gistxlogPageReuse *xlrec)
|
||||
{
|
||||
appendStringInfo(buf, "rel %u/%u/%u; blk %u; latestRemovedXid %u",
|
||||
appendStringInfo(buf, "rel %u/%u/%u; blk %u; latestRemovedXid %u:%u",
|
||||
xlrec->node.spcNode, xlrec->node.dbNode,
|
||||
xlrec->node.relNode, xlrec->block,
|
||||
xlrec->latestRemovedXid);
|
||||
EpochFromFullTransactionId(xlrec->latestRemovedFullXid),
|
||||
XidFromFullTransactionId(xlrec->latestRemovedFullXid));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -50,8 +51,10 @@ out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
|
||||
static void
|
||||
out_gistxlogPageDelete(StringInfo buf, gistxlogPageDelete *xlrec)
|
||||
{
|
||||
appendStringInfo(buf, "deleteXid %u; downlink %u",
|
||||
xlrec->deleteXid, xlrec->downlinkOffset);
|
||||
appendStringInfo(buf, "deleteXid %u:%u; downlink %u",
|
||||
EpochFromFullTransactionId(xlrec->deleteXid),
|
||||
XidFromFullTransactionId(xlrec->deleteXid),
|
||||
xlrec->downlinkOffset);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user