]> granicus.if.org Git - postgresql/commit
Simplify and improve ProcessStandbyHSFeedbackMessage logic.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 20 Oct 2011 23:43:31 +0000 (19:43 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 20 Oct 2011 23:43:45 +0000 (19:43 -0400)
commitd1d094e4cf7d80cb2b4f68b5e8ce11aa9ebcbf3c
tree4bfc68c15afd421339f218e72a60308ccf405523
parent790fa1fdd8bb32e2e9055dd47d76c2382c51c84a
Simplify and improve ProcessStandbyHSFeedbackMessage logic.

There's no need to clamp the standby's xmin to be greater than
GetOldestXmin's result; if there were any such need this logic would be
hopelessly inadequate anyway, because it fails to account for
within-database versus cluster-wide values of GetOldestXmin.  So get rid of
that, and just rely on sanity-checking that the xmin is not wrapped around
relative to the nextXid counter.  Also, don't reset the walsender's xmin if
the current feedback xmin is indeed out of range; that just creates more
problems than we already had.  Lastly, don't bother to take the
ProcArrayLock; there's no need to do that to set xmin.

Also improve the comments about this in GetOldestXmin itself.
src/backend/replication/walsender.c
src/backend/storage/ipc/procarray.c