Definition at line 453 of file receivelog.c.
454{
458
459
460
461
462
464 return false;
465
466
467
468
469
470
471
472
473
474
475
476
478 {
480 }
481 else
482 {
485 else
487 }
488
490 {
491 char *sysidentifier =
NULL;
493
494
495
496
498 {
500 return false;
501 }
502
504 {
505 pg_log_error(
"system identifier does not match between base backup and streaming connection");
507 return false;
508 }
510
512 {
513 pg_log_error(
"starting timeline %u is not present in the server",
515 return false;
516 }
517 }
518
519
520
521
522
524
525 while (1)
526 {
527
528
529
530
531
532
534 {
540 {
541
542 pg_log_error(
"could not send replication command \"%s\": %s",
545 return false;
546 }
547
548
549
550
551
553 {
554 pg_log_warning(
"unexpected response to TIMELINE_HISTORY command: got %d rows and %d fields, expected %d rows and %d fields",
556 }
557
558
562
564 }
565
566
567
568
569
571 return true;
572
573
577 {
580 }
587 {
588 pg_log_error(
"could not send replication command \"%s\": %s",
591 return false;
592 }
594
595
599
600
601
602
603
604
605
606
607
608
609
611 {
612
613
614
615
616
617
618
619
620
623
628
629
631 {
632 pg_log_error(
"server reported unexpected next timeline %u, following timeline %u",
635 }
637 {
638 pg_log_error(
"server stopped streaming timeline %u at %X/%08X, but reported next timeline %u to begin at %X/%08X",
642 }
643
644
647 {
648 pg_log_error(
"unexpected termination of replication stream: %s",
652 }
654
655
656
657
658
662 continue;
663 }
665 {
667
668
669
670
671
672
673
675 return true;
676 else
677 {
678 pg_log_error(
"replication stream was terminated before stop point");
680 }
681 }
682 else
683 {
684
685 pg_log_error(
"unexpected termination of replication stream: %s",
689 }
690 }
691
697 return false;
698}
PGresult * PQexec(PGconn *conn, const char *query)
#define PQresultErrorMessage
#define pg_log_warning(...)
PQExpBuffer createPQExpBuffer(void)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void destroyPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
static PGresult * HandleCopyStream(PGconn *conn, StreamCtl *stream, XLogRecPtr *stoppos)
static bool reportFlushPosition
static bool existsTimeLineHistoryFile(StreamCtl *stream)
static bool writeTimeLineHistoryFile(StreamCtl *stream, char *filename, char *content)
bool CheckServerVersionForStreaming(PGconn *conn)
static XLogRecPtr lastFlushPosition
static bool ReadEndOfStreamingResult(PGresult *res, XLogRecPtr *startpos, uint32 *timeline)
bool RunIdentifySystem(PGconn *conn, char **sysid, TimeLineID *starttli, XLogRecPtr *startpos, char **db_name)
#define AppendQuotedIdentifier(b, s)
stream_stop_callback stream_stop
WalWriteMethod * walmethod
int(* close)(Walfile *f, WalCloseMethod method)
const WalWriteMethodOps * ops
const char * GetLastWalMethodError(WalWriteMethod *wwmethod)
#define XLogSegmentOffset(xlogptr, wal_segsz_bytes)
#define LSN_FORMAT_ARGS(lsn)
References appendPQExpBuffer(), appendPQExpBufferStr(), AppendQuotedIdentifier, CheckServerVersionForStreaming(), WalWriteMethodOps::close, CLOSE_NO_RENAME, conn, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), error(), existsTimeLineHistoryFile(), fb(), GetLastWalMethodError(), HandleCopyStream(), lastFlushPosition, LSN_FORMAT_ARGS, WalWriteMethod::ops, Walfile::pathname, pg_free(), pg_log_error, pg_log_warning, PGRES_COMMAND_OK, PGRES_COPY_BOTH, PGRES_TUPLES_OK, PQclear, PQexec(), PQgetResult, PQgetvalue, PQnfields, PQntuples, PQresultErrorMessage, PQresultStatus, ReadEndOfStreamingResult(), StreamCtl::replication_slot, reportFlushPosition, RunIdentifySystem(), StreamCtl::startpos, StreamCtl::stream_stop, StreamCtl::synchronous, StreamCtl::sysidentifier, StreamCtl::timeline, walfile, StreamCtl::walmethod, WalSegSz, writeTimeLineHistoryFile(), and XLogSegmentOffset.
Referenced by LogStreamerMain(), and StreamLog().