On Sun, May 6, 2018 at 6:22 AM, Stas Kelvich <s.kelv...@postgrespro.ru> wrote: > Also each second GetSnapshotData writes globalxmin (as it was before > procArray->global_snapshot_xmin was taken into account) into a circle > buffer with a size equal to global_snapshot_defer_time value. That more > or less the same thing as with Snapshot Too Old feature, but with a > bucket size of 1 second instead of 1 minute. > procArray->global_snapshot_xmin is always set to oldest > value in circle buffer. > > This way xmin calculation is always gives a value that were > global_snapshot_xmin seconds ago and we have mapping from time (or > GlobalCSN) to globalxmin for each second in this range. So when > some backends imports global snapshot with some GlobalCSN, that > GlobalCSN is mapped to a xmin and this xmin is set as a Proc->xmin.
But what happens if a transaction starts on node A at time T0 but first touches node B at a much later time T1, such that T1 - T0 > global_snapshot_defer_time? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company