mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Re-run pgindent.
This is just to have a clean base state for testing of Piotr Stefaniak's latest version of FreeBSD indent. I fixed up a couple of places where pgindent would have changed format not-nicely. perltidy not included. Discussion: https://postgr.es/m/VI1PR03MB119959F4B65F000CA7CD9F6BF2CC0@VI1PR03MB1199.eurprd03.prod.outlook.com
This commit is contained in:
@ -1347,8 +1347,8 @@ InitResultRelInfo(ResultRelInfo *resultRelInfo,
|
|||||||
* partition, if there any BR triggers defined on the table. Although
|
* partition, if there any BR triggers defined on the table. Although
|
||||||
* tuple-routing implicitly preserves the partition constraint of the
|
* tuple-routing implicitly preserves the partition constraint of the
|
||||||
* target partition for a given row, the BR triggers may change the row
|
* target partition for a given row, the BR triggers may change the row
|
||||||
* such that the constraint is no longer satisfied, which we must fail
|
* such that the constraint is no longer satisfied, which we must fail for
|
||||||
* for by checking it explicitly.
|
* by checking it explicitly.
|
||||||
*
|
*
|
||||||
* If this is a partitioned table, the partition constraint (if any) of a
|
* If this is a partitioned table, the partition constraint (if any) of a
|
||||||
* given row will be checked just before performing tuple-routing.
|
* given row will be checked just before performing tuple-routing.
|
||||||
|
@ -196,7 +196,8 @@ pg_be_scram_init(const char *username, const char *shadow_pass)
|
|||||||
* parsed.
|
* parsed.
|
||||||
*/
|
*/
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("invalid SCRAM verifier for user \"%s\"", username)));
|
(errmsg("invalid SCRAM verifier for user \"%s\"",
|
||||||
|
username)));
|
||||||
got_verifier = false;
|
got_verifier = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,8 @@ finish_sync_worker(void)
|
|||||||
StartTransactionCommand();
|
StartTransactionCommand();
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("logical replication table synchronization worker for subscription \"%s\", table \"%s\" has finished",
|
(errmsg("logical replication table synchronization worker for subscription \"%s\", table \"%s\" has finished",
|
||||||
MySubscription->name, get_rel_name(MyLogicalRepWorker->relid))));
|
MySubscription->name,
|
||||||
|
get_rel_name(MyLogicalRepWorker->relid))));
|
||||||
CommitTransactionCommand();
|
CommitTransactionCommand();
|
||||||
|
|
||||||
/* Find the main apply worker and signal it. */
|
/* Find the main apply worker and signal it. */
|
||||||
@ -401,8 +402,8 @@ process_syncing_tables_for_apply(XLogRecPtr current_lsn)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Apply has caught up to the position where the table sync has
|
* Apply has caught up to the position where the table sync has
|
||||||
* finished. Mark the table as ready so that the apply will
|
* finished. Mark the table as ready so that the apply will just
|
||||||
* just continue to replicate it normally.
|
* continue to replicate it normally.
|
||||||
*/
|
*/
|
||||||
if (current_lsn >= rstate->lsn)
|
if (current_lsn >= rstate->lsn)
|
||||||
{
|
{
|
||||||
@ -436,9 +437,9 @@ process_syncing_tables_for_apply(XLogRecPtr current_lsn)
|
|||||||
else
|
else
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is no sync worker for this table yet, count running sync
|
* If there is no sync worker for this table yet, count
|
||||||
* workers for this subscription, while we have the lock, for
|
* running sync workers for this subscription, while we have
|
||||||
* later.
|
* the lock, for later.
|
||||||
*/
|
*/
|
||||||
nsyncworkers = logicalrep_sync_worker_count(MyLogicalRepWorker->subid);
|
nsyncworkers = logicalrep_sync_worker_count(MyLogicalRepWorker->subid);
|
||||||
LWLockRelease(LogicalRepWorkerLock);
|
LWLockRelease(LogicalRepWorkerLock);
|
||||||
@ -858,17 +859,17 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Use a standard write lock here. It might be better to
|
* Use a standard write lock here. It might be better to
|
||||||
* disallow access to the table while it's being synchronized. But
|
* disallow access to the table while it's being synchronized.
|
||||||
* we don't want to block the main apply process from working
|
* But we don't want to block the main apply process from
|
||||||
* and it has to open the relation in RowExclusiveLock when
|
* working and it has to open the relation in RowExclusiveLock
|
||||||
* remapping remote relation id to local one.
|
* when remapping remote relation id to local one.
|
||||||
*/
|
*/
|
||||||
rel = heap_open(MyLogicalRepWorker->relid, RowExclusiveLock);
|
rel = heap_open(MyLogicalRepWorker->relid, RowExclusiveLock);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a temporary slot for the sync process. We do this
|
* Create a temporary slot for the sync process. We do this
|
||||||
* inside the transaction so that we can use the snapshot made by
|
* inside the transaction so that we can use the snapshot made
|
||||||
* the slot to get existing data.
|
* by the slot to get existing data.
|
||||||
*/
|
*/
|
||||||
res = walrcv_exec(wrconn,
|
res = walrcv_exec(wrconn,
|
||||||
"BEGIN READ ONLY ISOLATION LEVEL "
|
"BEGIN READ ONLY ISOLATION LEVEL "
|
||||||
@ -916,7 +917,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
|
|||||||
/* Wait for main apply worker to tell us to catchup. */
|
/* Wait for main apply worker to tell us to catchup. */
|
||||||
wait_for_worker_state_change(SUBREL_STATE_CATCHUP);
|
wait_for_worker_state_change(SUBREL_STATE_CATCHUP);
|
||||||
|
|
||||||
/*
|
/*----------
|
||||||
* There are now two possible states here:
|
* There are now two possible states here:
|
||||||
* a) Sync is behind the apply. If that's the case we need to
|
* a) Sync is behind the apply. If that's the case we need to
|
||||||
* catch up with it by consuming the logical replication
|
* catch up with it by consuming the logical replication
|
||||||
@ -924,6 +925,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
|
|||||||
* function and continue in ApplyWorkerMain().
|
* function and continue in ApplyWorkerMain().
|
||||||
* b) Sync is caught up with the apply. So it can just set
|
* b) Sync is caught up with the apply. So it can just set
|
||||||
* the state to SYNCDONE and finish.
|
* the state to SYNCDONE and finish.
|
||||||
|
*----------
|
||||||
*/
|
*/
|
||||||
if (*origin_startpos >= MyLogicalRepWorker->relstate_lsn)
|
if (*origin_startpos >= MyLogicalRepWorker->relstate_lsn)
|
||||||
{
|
{
|
||||||
@ -943,9 +945,12 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
|
|||||||
case SUBREL_STATE_SYNCDONE:
|
case SUBREL_STATE_SYNCDONE:
|
||||||
case SUBREL_STATE_READY:
|
case SUBREL_STATE_READY:
|
||||||
case SUBREL_STATE_UNKNOWN:
|
case SUBREL_STATE_UNKNOWN:
|
||||||
/* Nothing to do here but finish. (UNKNOWN means the relation was
|
|
||||||
|
/*
|
||||||
|
* Nothing to do here but finish. (UNKNOWN means the relation was
|
||||||
* removed from pg_subscription_rel before the sync worker could
|
* removed from pg_subscription_rel before the sync worker could
|
||||||
* start.) */
|
* start.)
|
||||||
|
*/
|
||||||
finish_sync_worker();
|
finish_sync_worker();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1577,8 +1577,8 @@ ApplyWorkerMain(Datum main_arg)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This shouldn't happen if the subscription is enabled, but guard
|
* This shouldn't happen if the subscription is enabled, but guard
|
||||||
* against DDL bugs or manual catalog changes. (libpqwalreceiver
|
* against DDL bugs or manual catalog changes. (libpqwalreceiver will
|
||||||
* will crash if slot is NULL.
|
* crash if slot is NULL.)
|
||||||
*/
|
*/
|
||||||
if (!myslotname)
|
if (!myslotname)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -3639,8 +3639,8 @@ PostgresMain(int argc, char *argv[],
|
|||||||
WalSndSignals();
|
WalSndSignals();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read config
|
pqsignal(SIGHUP, PostgresSigHupHandler); /* set flag to read
|
||||||
* file */
|
* config file */
|
||||||
pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */
|
pqsignal(SIGINT, StatementCancelHandler); /* cancel current query */
|
||||||
pqsignal(SIGTERM, die); /* cancel current query and exit */
|
pqsignal(SIGTERM, die); /* cancel current query and exit */
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ typedef enum
|
|||||||
PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
|
PROCSIG_CATCHUP_INTERRUPT, /* sinval catchup interrupt */
|
||||||
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
|
PROCSIG_NOTIFY_INTERRUPT, /* listen/notify interrupt */
|
||||||
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
|
PROCSIG_PARALLEL_MESSAGE, /* message from cooperating parallel backend */
|
||||||
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for shutdown */
|
PROCSIG_WALSND_INIT_STOPPING, /* ask walsenders to prepare for
|
||||||
|
* shutdown */
|
||||||
|
|
||||||
/* Recovery conflict reasons */
|
/* Recovery conflict reasons */
|
||||||
PROCSIG_RECOVERY_CONFLICT_DATABASE,
|
PROCSIG_RECOVERY_CONFLICT_DATABASE,
|
||||||
|
@ -1844,14 +1844,21 @@ connectDBComplete(PGconn *conn)
|
|||||||
|
|
||||||
if (ret == 1) /* connect_timeout elapsed */
|
if (ret == 1) /* connect_timeout elapsed */
|
||||||
{
|
{
|
||||||
/* If there are no more hosts, return (the error message is already set) */
|
/*
|
||||||
|
* If there are no more hosts, return (the error message is
|
||||||
|
* already set)
|
||||||
|
*/
|
||||||
if (++conn->whichhost >= conn->nconnhost)
|
if (++conn->whichhost >= conn->nconnhost)
|
||||||
{
|
{
|
||||||
conn->whichhost = 0;
|
conn->whichhost = 0;
|
||||||
conn->status = CONNECTION_BAD;
|
conn->status = CONNECTION_BAD;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Attempt connection to the next host, starting the connect_timeout timer */
|
|
||||||
|
/*
|
||||||
|
* Attempt connection to the next host, starting the
|
||||||
|
* connect_timeout timer
|
||||||
|
*/
|
||||||
pqDropConnection(conn, true);
|
pqDropConnection(conn, true);
|
||||||
conn->addr_cur = conn->connhost[conn->whichhost].addrlist;
|
conn->addr_cur = conn->connhost[conn->whichhost].addrlist;
|
||||||
conn->status = CONNECTION_NEEDED;
|
conn->status = CONNECTION_NEEDED;
|
||||||
|
Reference in New Issue
Block a user