Set active snapshot before SyncMetadataToNodes().

pull/2997/head
Hadi Moshayedi 2019-09-18 18:39:23 -07:00
parent 46866066cf
commit d24cefd055
1 changed files with 7 additions and 0 deletions

View File

@ -375,6 +375,12 @@ CitusMaintenanceDaemonMain(Datum main_arg)
InvalidateMetadataSystemCache();
StartTransactionCommand();
/*
* Some functions in ruleutils.c, which we use to get the DDL for
* metadata propagation, require an active snapshot.
*/
PushActiveSnapshot(GetTransactionSnapshot());
if (!LockCitusExtension())
{
ereport(DEBUG1, (errmsg("could not lock the citus extension, "
@ -386,6 +392,7 @@ CitusMaintenanceDaemonMain(Datum main_arg)
Async_Notify(METADATA_SYNC_CHANNEL, NULL);
}
PopActiveSnapshot();
CommitTransactionCommand();
ProcessCompletedNotifies();