pgreceivexlog_check_stoppoint_v1.patch
application/octet-stream
Filename: pgreceivexlog_check_stoppoint_v1.patch
Type: application/octet-stream
Part: 0
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: context
Series: patch v1
| File | + | − |
|---|---|---|
| src/bin/pg_basebackup/receivelog.c | 10 | 0 |
*** a/src/bin/pg_basebackup/receivelog.c
--- b/src/bin/pg_basebackup/receivelog.c
***************
*** 587,597 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
--- 587,606 ----
}
PQclear(res);
+ /* Complain if we've not reached stop point yet */
+ if (stream_stop != NULL && !stream_stop(blockpos, timeline, false))
+ {
+ fprintf(stderr, _("%s: replication stream was terminated before stop point\n"),
+ progname);
+ goto error;
+ }
+
if (copybuf != NULL)
PQfreemem(copybuf);
if (walfile != -1 && close(walfile) != 0)
fprintf(stderr, _("%s: could not close file %s: %s\n"),
progname, current_walfile_name, strerror(errno));
+ walfile = -1;
return true;
error:
***************
*** 600,604 **** error:
--- 609,614 ----
if (walfile != -1 && close(walfile) != 0)
fprintf(stderr, _("%s: could not close file %s: %s\n"),
progname, current_walfile_name, strerror(errno));
+ walfile = -1;
return false;
}