fix-print-debug-source-history.patch

text/x-patch

Filename: fix-print-debug-source-history.patch
Type: text/x-patch
Part: 0
Message: Re: BUG #18575: Sometimes pg_rewind mistakenly assumes that nothing needs to be done.

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/bin/pg_rewind/pg_rewind.c 2 2
diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c
index 0841ab4135..0f9d38abd5 100644
--- a/src/bin/pg_rewind/pg_rewind.c
+++ b/src/bin/pg_rewind/pg_rewind.c
@@ -892,9 +892,9 @@ getTimelineHistory(TimeLineID tli, bool is_source, int *nentries)
 			pg_log_debug("Target timeline history:");
 
 		/*
-		 * Print the target timeline history.
+		 * Print the timeline history
 		 */
-		for (i = 0; i < targetNentries; i++)
+		for (i = 0; i < *nentries; i++)
 		{
 			TimeLineHistoryEntry *entry;