mirror of https://github.com/citusdata/citus.git
Adds EnableCreateDatabasePropagation flag check
parent
b474d98e5c
commit
95572c5ada
|
@ -513,7 +513,6 @@ GenerateRoleOptionsList(HeapTuple tuple)
|
|||
List *
|
||||
GenerateCreateOrAlterRoleCommand(Oid roleOid)
|
||||
{
|
||||
elog(LOG, "GenerateCreateOrAlterRoleCommand execution");
|
||||
|
||||
HeapTuple roleTuple = SearchSysCache1(AUTHOID, ObjectIdGetDatum(roleOid));
|
||||
Form_pg_authid role = ((Form_pg_authid) GETSTRUCT(roleTuple));
|
||||
|
|
|
@ -4771,13 +4771,15 @@ SendNodeWideObjectsSyncCommands(MetadataSyncContext *context)
|
|||
/*
|
||||
* SendDatabaseGrantSyncCommands sends database grants to roles to workers with
|
||||
* transactional or nontransactional mode according to transactionMode inside
|
||||
* metadataSyncContext.
|
||||
* metadataSyncContext in case of EnableCreateDatabasePropagation GUC set.
|
||||
* This function is called after SendNodeWideObjectsSyncCommands and SendDependencyCreationCommands
|
||||
* because we need both databases and roles to be created on the worker.
|
||||
*
|
||||
*/
|
||||
static void
|
||||
SendDatabaseGrantSyncCommands(MetadataSyncContext *context)
|
||||
{
|
||||
if(EnableCreateDatabasePropagation){
|
||||
/* propagate node wide objects. It includes only roles for now. */
|
||||
List *commandList = GenerateGrantDatabaseCommandList();
|
||||
|
||||
|
@ -4789,6 +4791,7 @@ SendDatabaseGrantSyncCommands(MetadataSyncContext *context)
|
|||
commandList = lcons(DISABLE_DDL_PROPAGATION, commandList);
|
||||
commandList = lappend(commandList, ENABLE_DDL_PROPAGATION);
|
||||
SendOrCollectCommandListToActivatedNodes(context, commandList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue