From 504fe10d1d260159369e10ff151ff28aaa091c44 Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Thu, 10 Sep 2026 13:33:21 -0700 Subject: [PATCH] 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 Discussion: https://postgr.es/m/14864.1788978951@localhost --- src/backend/replication/logical/snapbuild.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index f60bcf09605..de491ea0c4b 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -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 */