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

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

View File

@ -74,7 +74,11 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS
addresses);
if (depError != NULL)
{
RaiseDeferredError(depError, WARNING);
if (EnableUnsupportedFeatureMessages)
{
RaiseDeferredError(depError, WARNING);
}
return NIL;
}

View File

@ -1387,7 +1387,11 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString)
if (errMsg != NULL)
{
RaiseDeferredError(errMsg, WARNING);
if (EnableUnsupportedFeatureMessages)
{
RaiseDeferredError(errMsg, WARNING);
}
return NIL;
}

View File

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

View File

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

View File

@ -48,6 +48,7 @@
#include "distributed/local_executor.h"
#include "distributed/local_distributed_join_planner.h"
#include "distributed/locally_reserved_shared_connections.h"
#include "distributed/log_utils.h"
#include "distributed/maintenanced.h"
#include "distributed/shard_cleaner.h"
#include "distributed/metadata_utility.h"
@ -1153,6 +1154,17 @@ RegisterCitusConfigVariables(void)
GUC_STANDARD,
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(
"citus.enable_version_checks",
gettext_noop("Enables version checks during CREATE/ALTER EXTENSION commands"),

View File

@ -23,6 +23,12 @@
#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
* log the given log level.

View File

@ -16,6 +16,8 @@
#define CITUS_LOG_LEVEL_OFF 0
extern bool EnableUnsupportedFeatureMessages;
extern bool IsLoggableLevel(int logLevel);
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
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)