Compare commits

..

No commits in common. "edbd1b41ab5bd4be06dbebb3c60149f7910d7c5c" and "807369d80384cdaa696cd65b4fcee46e32142344" have entirely different histories.

4 changed files with 13 additions and 43 deletions

View File

@ -623,22 +623,6 @@ InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdown_ptr,
if (StandbyModeRequested) if (StandbyModeRequested)
EnableStandbyMode(); EnableStandbyMode();
/*
* Omitting backup_label when creating a new replica, PITR node etc.
* unfortunately is a common cause of corruption. Logging that
* backup_label was used makes it a bit easier to exclude that as the
* cause of observed corruption.
*
* Do so before we try to read the checkpoint record (which can fail),
* as otherwise it can be hard to understand why a checkpoint other
* than ControlFile->checkPoint is used.
*/
ereport(LOG,
(errmsg("starting backup recovery with redo LSN %X/%X, checkpoint LSN %X/%X, on timeline ID %u",
LSN_FORMAT_ARGS(RedoStartLSN),
LSN_FORMAT_ARGS(CheckPointLoc),
CheckPointTLI)));
/* /*
* When a backup_label file is present, we want to roll forward from * When a backup_label file is present, we want to roll forward from
* the checkpoint it identifies, rather than using pg_control. * the checkpoint it identifies, rather than using pg_control.
@ -777,16 +761,6 @@ InitWalRecovery(ControlFileData *ControlFile, bool *wasShutdown_ptr,
EnableStandbyMode(); EnableStandbyMode();
} }
/*
* For the same reason as when starting up with backup_label present,
* emit a log message when we continue initializing from a base
* backup.
*/
if (!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
ereport(LOG,
(errmsg("restarting backup recovery with redo LSN %X/%X",
LSN_FORMAT_ARGS(ControlFile->backupStartPoint))));
/* Get the last valid checkpoint record. */ /* Get the last valid checkpoint record. */
CheckPointLoc = ControlFile->checkPoint; CheckPointLoc = ControlFile->checkPoint;
CheckPointTLI = ControlFile->checkPointCopy.ThisTimeLineID; CheckPointTLI = ControlFile->checkPointCopy.ThisTimeLineID;
@ -2149,9 +2123,6 @@ CheckRecoveryConsistency(void)
if (!XLogRecPtrIsInvalid(backupEndPoint) && if (!XLogRecPtrIsInvalid(backupEndPoint) &&
backupEndPoint <= lastReplayedEndRecPtr) backupEndPoint <= lastReplayedEndRecPtr)
{ {
XLogRecPtr saveBackupStartPoint = backupStartPoint;
XLogRecPtr saveBackupEndPoint = backupEndPoint;
elog(DEBUG1, "end of backup reached"); elog(DEBUG1, "end of backup reached");
/* /*
@ -2162,11 +2133,6 @@ CheckRecoveryConsistency(void)
backupStartPoint = InvalidXLogRecPtr; backupStartPoint = InvalidXLogRecPtr;
backupEndPoint = InvalidXLogRecPtr; backupEndPoint = InvalidXLogRecPtr;
backupEndRequired = false; backupEndRequired = false;
ereport(LOG,
(errmsg("completed backup recovery with redo LSN %X/%X and end LSN %X/%X",
LSN_FORMAT_ARGS(saveBackupStartPoint),
LSN_FORMAT_ARGS(saveBackupEndPoint))));
} }
/* /*

View File

@ -1093,7 +1093,7 @@ DropRole(DropRoleStmt *stmt)
Relation pg_authid_rel, Relation pg_authid_rel,
pg_auth_members_rel; pg_auth_members_rel;
ListCell *item; ListCell *item;
List *role_oids = NIL; List *role_addresses = NIL;
if (!have_createrole_privilege()) if (!have_createrole_privilege())
ereport(ERROR, ereport(ERROR,
@ -1119,6 +1119,7 @@ DropRole(DropRoleStmt *stmt)
ScanKeyData scankey; ScanKeyData scankey;
SysScanDesc sscan; SysScanDesc sscan;
Oid roleid; Oid roleid;
ObjectAddress *role_address;
if (rolspec->roletype != ROLESPEC_CSTRING) if (rolspec->roletype != ROLESPEC_CSTRING)
ereport(ERROR, ereport(ERROR,
@ -1259,16 +1260,21 @@ DropRole(DropRoleStmt *stmt)
*/ */
CommandCounterIncrement(); CommandCounterIncrement();
/* Looks tentatively OK, add it to the list if not there yet. */ /* Looks tentatively OK, add it to the list. */
role_oids = list_append_unique_oid(role_oids, roleid); role_address = palloc(sizeof(ObjectAddress));
role_address->classId = AuthIdRelationId;
role_address->objectId = roleid;
role_address->objectSubId = 0;
role_addresses = lappend(role_addresses, role_address);
} }
/* /*
* Second pass over the roles to be removed. * Second pass over the roles to be removed.
*/ */
foreach(item, role_oids) foreach(item, role_addresses)
{ {
Oid roleid = lfirst_oid(item); ObjectAddress *role_address = lfirst(item);
Oid roleid = role_address->objectId;
HeapTuple tuple; HeapTuple tuple;
Form_pg_authid roleform; Form_pg_authid roleform;
char *detail; char *detail;

View File

@ -251,8 +251,7 @@ DROP INDEX tenant_idx;
DROP TABLE tenant_table; DROP TABLE tenant_table;
DROP VIEW tenant_view; DROP VIEW tenant_view;
DROP SCHEMA regress_tenant2_schema; DROP SCHEMA regress_tenant2_schema;
-- check for duplicated drop DROP ROLE regress_tenant;
DROP ROLE regress_tenant, regress_tenant;
DROP ROLE regress_tenant2; DROP ROLE regress_tenant2;
DROP ROLE regress_rolecreator; DROP ROLE regress_rolecreator;
DROP ROLE regress_role_admin; DROP ROLE regress_role_admin;

View File

@ -206,8 +206,7 @@ DROP INDEX tenant_idx;
DROP TABLE tenant_table; DROP TABLE tenant_table;
DROP VIEW tenant_view; DROP VIEW tenant_view;
DROP SCHEMA regress_tenant2_schema; DROP SCHEMA regress_tenant2_schema;
-- check for duplicated drop DROP ROLE regress_tenant;
DROP ROLE regress_tenant, regress_tenant;
DROP ROLE regress_tenant2; DROP ROLE regress_tenant2;
DROP ROLE regress_rolecreator; DROP ROLE regress_rolecreator;
DROP ROLE regress_role_admin; DROP ROLE regress_role_admin;