enable propagation warnings before postgres vanilla tests (#6081)

pull/6086/head
aykut-bozkurt 2022-07-27 10:34:41 +03:00 committed by GitHub
parent b3dcfddeb3
commit 5f27445b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 54 additions and 13 deletions

View File

@ -38,10 +38,13 @@ PreprocessClusterStmt(Node *node, const char *clusterCommand,
bool missingOK = false; bool missingOK = false;
if (clusterStmt->relation == NULL) if (clusterStmt->relation == NULL)
{
if (EnableUnsupportedFeatureMessages)
{ {
ereport(WARNING, (errmsg("not propagating CLUSTER command to worker nodes"), ereport(WARNING, (errmsg("not propagating CLUSTER command to worker nodes"),
errhint("Provide a specific table in order to CLUSTER " errhint("Provide a specific table in order to CLUSTER "
"distributed tables."))); "distributed tables.")));
}
return NIL; return NIL;
} }

View File

@ -73,8 +73,12 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS
DeferredErrorMessage *depError = DeferErrorIfAnyObjectHasUnsupportedDependency( DeferredErrorMessage *depError = DeferErrorIfAnyObjectHasUnsupportedDependency(
addresses); addresses);
if (depError != NULL) if (depError != NULL)
{
if (EnableUnsupportedFeatureMessages)
{ {
RaiseDeferredError(depError, WARNING); RaiseDeferredError(depError, WARNING);
}
return NIL; return NIL;
} }

View File

@ -1386,8 +1386,12 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString)
functionAddresses); functionAddresses);
if (errMsg != NULL) if (errMsg != NULL)
{
if (EnableUnsupportedFeatureMessages)
{ {
RaiseDeferredError(errMsg, WARNING); RaiseDeferredError(errMsg, WARNING);
}
return NIL; return NIL;
} }

View File

@ -1753,11 +1753,14 @@ AnyForeignKeyDependsOnIndex(Oid indexId)
List * List *
PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString, PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString,
ProcessUtilityContext processUtilityContext) ProcessUtilityContext processUtilityContext)
{
if (EnableUnsupportedFeatureMessages)
{ {
ereport(WARNING, (errmsg("not propagating ALTER TABLE ALL IN TABLESPACE " ereport(WARNING, (errmsg("not propagating ALTER TABLE ALL IN TABLESPACE "
"commands to worker nodes"), "commands to worker nodes"),
errhint("Connect to worker nodes directly to manually " errhint("Connect to worker nodes directly to manually "
"move all tables."))); "move all tables.")));
}
return NIL; return NIL;
} }

View File

@ -734,12 +734,16 @@ ProcessUtilityInternal(PlannedStmt *pstmt,
if (IsA(parsetree, RenameStmt) && ((RenameStmt *) parsetree)->renameType == if (IsA(parsetree, RenameStmt) && ((RenameStmt *) parsetree)->renameType ==
OBJECT_ROLE && EnableAlterRolePropagation) OBJECT_ROLE && EnableAlterRolePropagation)
{ {
ereport(NOTICE, (errmsg("not propagating ALTER ROLE ... RENAME TO commands " if (EnableUnsupportedFeatureMessages)
{
ereport(NOTICE, (errmsg(
"not propagating ALTER ROLE ... RENAME TO commands "
"to worker nodes"), "to worker nodes"),
errhint("Connect to worker nodes directly to manually " errhint("Connect to worker nodes directly to manually "
"rename the role"))); "rename the role")));
} }
} }
}
if (IsA(parsetree, CreateStmt)) if (IsA(parsetree, CreateStmt))
{ {

View File

@ -48,6 +48,7 @@
#include "distributed/local_executor.h" #include "distributed/local_executor.h"
#include "distributed/local_distributed_join_planner.h" #include "distributed/local_distributed_join_planner.h"
#include "distributed/locally_reserved_shared_connections.h" #include "distributed/locally_reserved_shared_connections.h"
#include "distributed/log_utils.h"
#include "distributed/maintenanced.h" #include "distributed/maintenanced.h"
#include "distributed/shard_cleaner.h" #include "distributed/shard_cleaner.h"
#include "distributed/metadata_utility.h" #include "distributed/metadata_utility.h"
@ -1153,6 +1154,17 @@ RegisterCitusConfigVariables(void)
GUC_STANDARD, GUC_STANDARD,
NULL, NULL, NULL); NULL, NULL, NULL);
DefineCustomBoolVariable(
"citus.enable_unsupported_feature_messages",
gettext_noop("Controls showing of some citus related messages. It is intended to "
"be used before vanilla tests to stop unwanted citus messages."),
NULL,
&EnableUnsupportedFeatureMessages,
true,
PGC_SUSET,
GUC_SUPERUSER_ONLY | GUC_NO_SHOW_ALL,
NULL, NULL, NULL);
DefineCustomBoolVariable( DefineCustomBoolVariable(
"citus.enable_version_checks", "citus.enable_version_checks",
gettext_noop("Enables version checks during CREATE/ALTER EXTENSION commands"), gettext_noop("Enables version checks during CREATE/ALTER EXTENSION commands"),

View File

@ -23,6 +23,12 @@
#endif #endif
/*
* GUC controls showing of some of the unwanted citus messages, it is intended to be set false
* before vanilla tests to not break postgres test logs.
*/
bool EnableUnsupportedFeatureMessages = true;
/* /*
* IsLoggableLevel returns true if either of client or server log guc is configured to * IsLoggableLevel returns true if either of client or server log guc is configured to
* log the given log level. * log the given log level.

View File

@ -16,6 +16,8 @@
#define CITUS_LOG_LEVEL_OFF 0 #define CITUS_LOG_LEVEL_OFF 0
extern bool EnableUnsupportedFeatureMessages;
extern bool IsLoggableLevel(int logLevel); extern bool IsLoggableLevel(int logLevel);
extern char * HashLogMessage(const char *text); extern char * HashLogMessage(const char *text);

View File

@ -500,6 +500,9 @@ if(!$vanillaDev && $vanillatest)
{ {
# we enable hiding the citus dependent objects from pg meta class queries to not break postgres vanilla test behaviour # we enable hiding the citus dependent objects from pg meta class queries to not break postgres vanilla test behaviour
push(@pgOptions, "citus.hide_citus_dependent_objects=true"); push(@pgOptions, "citus.hide_citus_dependent_objects=true");
# we disable citus related unwanted messages to not break postgres vanilla test behaviour.
push(@pgOptions, "citus.enable_unsupported_feature_messages=false");
} }
if ($useMitmproxy) if ($useMitmproxy)