pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: amcheck: Fix ordering bug in update_cached_xid_range() 3+ messages / 1 participants [nested] [flat]
* pgsql: amcheck: Fix ordering bug in update_cached_xid_range() @ 2023-03-11 22:55 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2023-03-11 22:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org amcheck: Fix ordering bug in update_cached_xid_range() The initialization order in update_cached_xid_range() was wrong, calling FullTransactionIdFromXidAndCtx() before setting ->next_xid. FullTransactionIdFromXidAndCtx() uses ->next_xid. In most situations this will not cause visible issues, because the next call to update_cached_xid_range() will use a less wrong ->next_xid. It's rare that xids advance fast enough for this to be a problem. Found while adding more asserts to the 64bit xid infrastructure. Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://postgr.es/m/20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de Backpatch: 14-, where heapam verification was introduced Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/16327240da29b70e41a65d49212b31da9a94e177 Modified Files -------------- contrib/amcheck/verify_heapam.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: amcheck: Fix ordering bug in update_cached_xid_range() @ 2023-03-11 22:55 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2023-03-11 22:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org amcheck: Fix ordering bug in update_cached_xid_range() The initialization order in update_cached_xid_range() was wrong, calling FullTransactionIdFromXidAndCtx() before setting ->next_xid. FullTransactionIdFromXidAndCtx() uses ->next_xid. In most situations this will not cause visible issues, because the next call to update_cached_xid_range() will use a less wrong ->next_xid. It's rare that xids advance fast enough for this to be a problem. Found while adding more asserts to the 64bit xid infrastructure. Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://postgr.es/m/20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de Backpatch: 14-, where heapam verification was introduced Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6d9588108a5644800b0047ccb666f70373164f68 Modified Files -------------- contrib/amcheck/verify_heapam.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: amcheck: Fix ordering bug in update_cached_xid_range() @ 2023-03-11 22:55 Andres Freund <andres@anarazel.de> 0 siblings, 0 replies; 3+ messages in thread From: Andres Freund @ 2023-03-11 22:55 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org amcheck: Fix ordering bug in update_cached_xid_range() The initialization order in update_cached_xid_range() was wrong, calling FullTransactionIdFromXidAndCtx() before setting ->next_xid. FullTransactionIdFromXidAndCtx() uses ->next_xid. In most situations this will not cause visible issues, because the next call to update_cached_xid_range() will use a less wrong ->next_xid. It's rare that xids advance fast enough for this to be a problem. Found while adding more asserts to the 64bit xid infrastructure. Reviewed-by: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://postgr.es/m/20230108002923.cyoser3ttmt63bfn@awork3.anarazel.de Backpatch: 14-, where heapam verification was introduced Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a42f515d6b45ea19b96fb2868d8acb77251d911d Modified Files -------------- contrib/amcheck/verify_heapam.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-03-11 22:55 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-03-11 22:55 pgsql: amcheck: Fix ordering bug in update_cached_xid_range() Andres Freund <andres@anarazel.de> 2023-03-11 22:55 pgsql: amcheck: Fix ordering bug in update_cached_xid_range() Andres Freund <andres@anarazel.de> 2023-03-11 22:55 pgsql: amcheck: Fix ordering bug in update_cached_xid_range() Andres Freund <andres@anarazel.de>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox