1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Fix misplaced comment in snapbuild.c.

Commits 2bef06d516 and 240e0dbacd added code between the comment and
the assignment it describes, so the comment now appears to explain an
unrelated line. Move it back to its original place.

Author: Antonin Houska <ah@cybertec.at>
Discussion: https://postgr.es/m/14864.1788978951@localhost
This commit is contained in:
Masahiko Sawada
2026-09-10 13:33:21 -07:00
parent 8367b63e2c
commit 504fe10d1d

View File

@@ -471,10 +471,6 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
snap = SnapBuildBuildSnapshot(builder);
/*
* We know that snap->xmin is alive, enforced by the logical xmin
* mechanism. Due to that we can do this without locks, we're only
* changing our own value.
*
* Building an initial snapshot is expensive and an unenforced xmin
* horizon would have bad consequences, therefore always double-check that
* the horizon is enforced.
@@ -487,6 +483,11 @@ SnapBuildInitialSnapshot(SnapBuild *builder)
elog(ERROR, "cannot build an initial slot snapshot as oldest safe xid %u follows snapshot's xmin %u",
safeXid, snap->xmin);
/*
* We know that snap->xmin is alive, enforced by the logical xmin
* mechanism. Due to that we can do this without locks, we're only
* changing our own value.
*/
MyProc->xmin = snap->xmin;
/* allocate in transaction context */