public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v3 3/3] Fix timeline-tracking failure while sending a historic timeline
3+ messages / 3 participants
[nested] [flat]

* [PATCH v3 3/3] Fix timeline-tracking failure while sending a historic timeline
@ 2020-12-09 08:22 Kyotaro Horiguchi <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Kyotaro Horiguchi @ 2020-12-09 08:22 UTC (permalink / raw)

Walsender should track timeline switches while sending a historic
timeline. Regain that behavior, which was broken in PG13, by a thinko
of 709d003fbd.
---
 src/backend/replication/walsender.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index fe0d368a35..8545c6c423 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -2491,7 +2491,7 @@ WalSndSegmentOpen(XLogReaderState *state, XLogSegNo nextSegNo,
 		XLogSegNo	endSegNo;
 
 		XLByteToSeg(sendTimeLineValidUpto, endSegNo, state->segcxt.ws_segsize);
-		if (state->seg.ws_segno == endSegNo)
+		if (nextSegNo == endSegNo)
 			*tli_p = sendTimeLineNextTLI;
 	}
 
-- 
2.27.0


----Next_Part(Tue_Jan__5_17_26_02_2021_224)----





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgindent vs. git whitespace check
@ 2023-02-22 08:17 Peter Eisentraut <[email protected]>
  2023-02-22 14:49 ` Re: pgindent vs. git whitespace check Alvaro Herrera <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Peter Eisentraut @ 2023-02-22 08:17 UTC (permalink / raw)
  To: pgsql-hackers

Commit e4602483e95 accidentally introduced a situation where pgindent
disagrees with the git whitespace check.  The code is

         conn = libpqsrv_connect_params(keywords, values,
                                         /* expand_dbname = */ false,
                                        PG_WAIT_EXTENSION);

where the current source file has 4 spaces before the /*, and the
whitespace check says that that should be a tab.

I think it should actually be 3 spaces, so that the "/*..." lines up
with the "keywords..." and "PG_WAIT..." above and below.

I suppose this isn't going to be a quick fix in pgindent, but if someone
is keeping track, maybe this could be added to the to-consider list.

In the meantime, I suggest we work around this, perhaps by

         conn = libpqsrv_connect_params(keywords, values, /* expand_dbname = */ false,
                                        PG_WAIT_EXTENSION);

which appears to be robust for both camps.






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgindent vs. git whitespace check
  2023-02-22 08:17 pgindent vs. git whitespace check Peter Eisentraut <[email protected]>
@ 2023-02-22 14:49 ` Alvaro Herrera <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Alvaro Herrera @ 2023-02-22 14:49 UTC (permalink / raw)
  To: Peter Eisentraut <[email protected]>; +Cc: pgsql-hackers

On 2023-Feb-22, Peter Eisentraut wrote:

> In the meantime, I suggest we work around this, perhaps by
> 
>         conn = libpqsrv_connect_params(keywords, values, /* expand_dbname = */ false,
>                                        PG_WAIT_EXTENSION);

I suggest

         conn = libpqsrv_connect_params(keywords, values,
		 								false, /* expand_dbname */
                                        PG_WAIT_EXTENSION);

which is what we typically do elsewhere and doesn't go overlength.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
Maybe there's lots of data loss but the records of data loss are also lost.
(Lincoln Yeoh)






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2023-02-22 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 08:22 [PATCH v3 3/3] Fix timeline-tracking failure while sending a historic timeline Kyotaro Horiguchi <[email protected]>
2023-02-22 08:17 pgindent vs. git whitespace check Peter Eisentraut <[email protected]>
2023-02-22 14:49 ` Re: pgindent vs. git whitespace check Alvaro Herrera <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox