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