From 70d8e1fe973b12342afd2406d6402d6dccb00f4e Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Thu, 13 Jan 2022 19:09:57 +0300 Subject: [PATCH] Assert that we will create indexes on shards via local execution (#5620) --- src/backend/distributed/commands/utility_hook.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/distributed/commands/utility_hook.c b/src/backend/distributed/commands/utility_hook.c index 520d7f7fd..4c79ec3e1 100644 --- a/src/backend/distributed/commands/utility_hook.c +++ b/src/backend/distributed/commands/utility_hook.c @@ -1201,6 +1201,15 @@ ExecuteDistributedDDLJob(DDLJob *ddlJob) * snapshots via adaptive executor. */ set_indexsafe_procflags(); + + /* + * We should not have any CREATE INDEX commands go through the + * local backend as we signaled other backends that this backend + * is executing a "safe" index command (PROC_IN_SAFE_IC), which + * is NOT true, we are only faking postgres based on the reasoning + * given above. + */ + Assert(localExecutionSupported == false); #endif }