Thanks, Dipesh. The patch LGTM.
+ *
+ * "nextLogSegNo" identifies the next log file to be archived in a log
+ * sequence and the flag "dirScan" specifies a full directory scan to find
+ * the next log file.
IMHO, this comment should go atop of pgarch_readyXlog() as a description
of its parameters, and not in pgarch_ArchiverCopyLoop().
/*
+ * Interrupt handler for archiver
+ *
+ * There is a timeline switch and we have been notified by backend.
+ */
Instead, I would suggest having something like this:
+/*
+ * Interrupt handler for handling the timeline switch.
+ *
+ * A timeline switch has been notified, mark this event so that the next iteration
+ * of pgarch_ArchiverCopyLoop() archives the history file, and we set the
+ * timeline to the new one for the next anticipated log segment.
+ */
Regards,
Jeevan Ladhe