Fix comment in SnapBuildFindSnapshot
Hi,
We have the following comment in SnapBuildFindSnapshot():
* c) transition from FULL_SNAPSHOT to CONSISTENT.
*
* In FULL_SNAPSHOT state (see d) ), and this xl_running_xacts'
It mentions "(state d) )", which seems like a typo of "(state d)", but
there is no "state d" in the first place. Reading the discussion of
the commit 955a684e040 that introduced this comment, this was a
comment for an old version patch[1]/messages/by-id/20170505004237.edtahvrwb3uwd5rs@alap3.anarazel.de. So I think we can remove this
part.
I've attached the patch.
Regards,
[1]: /messages/by-id/20170505004237.edtahvrwb3uwd5rs@alap3.anarazel.de
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
Attachments:
fix_comment_in_SnapBuildFindSnapshot.patchapplication/octet-stream; name=fix_comment_in_SnapBuildFindSnapshot.patchDownload
diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c
index a1fd1d92d6..beddcbcdea 100644
--- a/src/backend/replication/logical/snapbuild.c
+++ b/src/backend/replication/logical/snapbuild.c
@@ -1464,11 +1464,10 @@ SnapBuildFindSnapshot(SnapBuild *builder, XLogRecPtr lsn, xl_running_xacts *runn
/*
* c) transition from FULL_SNAPSHOT to CONSISTENT.
*
- * In FULL_SNAPSHOT state (see d) ), and this xl_running_xacts'
- * oldestRunningXid is >= than nextXid from when we switched to
- * FULL_SNAPSHOT. This means all transactions that are currently in
- * progress have a catalog snapshot, and all their changes have been
- * collected. Switch to CONSISTENT.
+ * In FULL_SNAPSHOT state, and this xl_running_xacts' oldestRunningXid is
+ * >= than nextXid from when we switched to FULL_SNAPSHOT. This means all
+ * transactions that are currently in progress have a catalog snapshot,
+ * and all their changes have been collected. Switch to CONSISTENT.
*/
else if (builder->state == SNAPBUILD_FULL_SNAPSHOT &&
TransactionIdPrecedesOrEquals(builder->next_phase_at,
On Mon, Nov 28, 2022 at 11:13:23AM +0900, Masahiko Sawada wrote:
We have the following comment in SnapBuildFindSnapshot():
* c) transition from FULL_SNAPSHOT to CONSISTENT.
*
* In FULL_SNAPSHOT state (see d) ), and this xl_running_xacts'It mentions "(state d) )", which seems like a typo of "(state d)", but
there is no "state d" in the first place. Reading the discussion of
the commit 955a684e040 that introduced this comment, this was a
comment for an old version patch[1]. So I think we can remove this
part.
Hm, yes, that seems right. There are three "c) states" in these
paragraphs, they are incremental steps. Will apply if there are no
objections.
--
Michael
On Mon, Nov 28, 2022 at 04:46:44PM +0900, Michael Paquier wrote:
Hm, yes, that seems right. There are three "c) states" in these
paragraphs, they are incremental steps. Will apply if there are no
objections.
And done.
--
Michael
On Tue, Nov 29, 2022 at 8:54 AM Michael Paquier <michael@paquier.xyz> wrote:
On Mon, Nov 28, 2022 at 04:46:44PM +0900, Michael Paquier wrote:
Hm, yes, that seems right. There are three "c) states" in these
paragraphs, they are incremental steps. Will apply if there are no
objections.And done.
Thank you!
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com