From 639588bee01015a2156bb2589800e402aec4afd8 Mon Sep 17 00:00:00 2001 From: Marco Slot Date: Mon, 22 Aug 2022 10:53:25 +0200 Subject: [PATCH] Remove unused functions (#6220) Co-authored-by: Marco Slot --- .../distributed/commands/foreign_constraint.c | 13 -- src/backend/distributed/commands/multi_copy.c | 13 +- .../distributed/commands/utility_hook.c | 47 ------- .../distributed/connection/remote_commands.c | 8 +- .../connection/worker_log_messages.c | 2 +- .../distributed/executor/local_executor.c | 2 +- .../executor/multi_client_executor.c | 4 +- .../distributed/metadata/metadata_cache.c | 47 ------- .../distributed/metadata/metadata_utility.c | 15 -- .../operations/modify_multiple_shards.c | 2 +- .../distributed/planner/deparse_shard_query.c | 4 +- .../planner/insert_select_planner.c | 2 +- .../distributed/planner/multi_join_order.c | 2 +- .../planner/multi_physical_planner.c | 43 +----- .../distributed/planner/recursive_planning.c | 6 +- .../distributed_deadlock_detection.c | 2 +- .../transaction/worker_transaction.c | 131 +----------------- src/backend/distributed/utils/directory.c | 29 ---- src/backend/distributed/utils/log_utils.c | 11 -- .../worker/worker_data_fetch_protocol.c | 2 +- src/include/distributed/commands.h | 1 - .../distributed/commands/utility_hook.h | 3 - src/include/distributed/log_utils.h | 4 - src/include/distributed/metadata_cache.h | 3 - src/include/distributed/metadata_utility.h | 1 - .../distributed/multi_physical_planner.h | 1 - src/include/distributed/utils/directory.h | 1 - src/include/distributed/worker_transaction.h | 5 - 28 files changed, 21 insertions(+), 383 deletions(-) diff --git a/src/backend/distributed/commands/foreign_constraint.c b/src/backend/distributed/commands/foreign_constraint.c index a84e8cce2..62d004792 100644 --- a/src/backend/distributed/commands/foreign_constraint.c +++ b/src/backend/distributed/commands/foreign_constraint.c @@ -745,19 +745,6 @@ GetForeignKeysFromLocalTables(Oid relationId) } -/* - * HasForeignKeyToCitusLocalTable returns true if any of the foreign key constraints - * on the relation with relationId references to a citus local table. - */ -bool -HasForeignKeyToCitusLocalTable(Oid relationId) -{ - int flags = INCLUDE_REFERENCING_CONSTRAINTS | INCLUDE_CITUS_LOCAL_TABLES; - List *foreignKeyOidList = GetForeignKeyOids(relationId, flags); - return list_length(foreignKeyOidList) > 0; -} - - /* * HasForeignKeyToReferenceTable returns true if any of the foreign key * constraints on the relation with relationId references to a reference diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index d795fddde..b5ac6a519 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -217,15 +217,6 @@ struct CopyShardState List *placementStateList; }; -/* ShardConnections represents a set of connections for each placement of a shard */ -typedef struct ShardConnections -{ - int64 shardId; - - /* list of MultiConnection structs */ - List *connectionList; -} ShardConnections; - /* * Represents the state for allowing copy via local @@ -1195,7 +1186,7 @@ ReportCopyError(MultiConnection *connection, PGresult *result) bool haveDetail = remoteDetail != NULL; ereport(ERROR, (errmsg("%s", remoteMessage), - haveDetail ? errdetail("%s", ApplyLogRedaction(remoteDetail)) : + haveDetail ? errdetail("%s", remoteDetail) : 0)); } else @@ -1206,7 +1197,7 @@ ReportCopyError(MultiConnection *connection, PGresult *result) ereport(ERROR, (errcode(ERRCODE_IO_ERROR), errmsg("failed to complete COPY on %s:%d", connection->hostname, connection->port), - errdetail("%s", ApplyLogRedaction(remoteMessage)))); + errdetail("%s", remoteMessage))); } } diff --git a/src/backend/distributed/commands/utility_hook.c b/src/backend/distributed/commands/utility_hook.c index 9b0a79e22..8bfd5df44 100644 --- a/src/backend/distributed/commands/utility_hook.c +++ b/src/backend/distributed/commands/utility_hook.c @@ -1415,53 +1415,6 @@ set_indexsafe_procflags(void) #endif -/* - * CreateCustomDDLTaskList creates a DDLJob which will apply a command to all placements - * of shards of a distributed table. The command to be applied is generated by the - * TableDDLCommand structure passed in. - */ -DDLJob * -CreateCustomDDLTaskList(Oid relationId, TableDDLCommand *command) -{ - List *taskList = NIL; - List *shardIntervalList = LoadShardIntervalList(relationId); - uint64 jobId = INVALID_JOB_ID; - Oid namespace = get_rel_namespace(relationId); - char *namespaceName = get_namespace_name(namespace); - int taskId = 1; - - /* lock metadata before getting placement lists */ - LockShardListMetadata(shardIntervalList, ShareLock); - - ShardInterval *shardInterval = NULL; - foreach_ptr(shardInterval, shardIntervalList) - { - uint64 shardId = shardInterval->shardId; - - char *commandStr = GetShardedTableDDLCommand(command, shardId, namespaceName); - - Task *task = CitusMakeNode(Task); - task->jobId = jobId; - task->taskId = taskId++; - task->taskType = DDL_TASK; - SetTaskQueryString(task, commandStr); - task->replicationModel = REPLICATION_MODEL_INVALID; - task->dependentTaskList = NULL; - task->anchorShardId = shardId; - task->taskPlacementList = ActiveShardPlacementList(shardId); - - taskList = lappend(taskList, task); - } - - DDLJob *ddlJob = palloc0(sizeof(DDLJob)); - ObjectAddressSet(ddlJob->targetObjectAddress, RelationRelationId, relationId); - ddlJob->metadataSyncCommand = GetTableDDLCommand(command); - ddlJob->taskList = taskList; - - return ddlJob; -} - - /* * SetSearchPathToCurrentSearchPathCommand generates a command which can * set the search path to the exact same search path that the issueing node diff --git a/src/backend/distributed/connection/remote_commands.c b/src/backend/distributed/connection/remote_commands.c index a7e96efed..c5aeefd51 100644 --- a/src/backend/distributed/connection/remote_commands.c +++ b/src/backend/distributed/connection/remote_commands.c @@ -258,10 +258,6 @@ ReportConnectionError(MultiConnection *connection, int elevel) if (messageDetail) { - /* - * We don't use ApplyLogRedaction(messageDetail) as we expect any error - * detail that requires log reduction should have done it locally. - */ ereport(elevel, (errcode(ERRCODE_CONNECTION_FAILURE), errmsg("connection to the remote node %s:%d failed with the " "following error: %s", nodeName, nodePort, @@ -315,7 +311,7 @@ ReportResultError(MultiConnection *connection, PGresult *result, int elevel) ereport(elevel, (errcode(sqlState), errmsg("%s", messagePrimary), messageDetail ? - errdetail("%s", ApplyLogRedaction(messageDetail)) : 0, + errdetail("%s", messageDetail) : 0, messageHint ? errhint("%s", messageHint) : 0, messageContext ? errcontext("%s", messageContext) : 0, errcontext("while executing command on %s:%d", @@ -349,7 +345,7 @@ LogRemoteCommand(MultiConnection *connection, const char *command) return; } - ereport(NOTICE, (errmsg("issuing %s", ApplyLogRedaction(command)), + ereport(NOTICE, (errmsg("issuing %s", command), errdetail("on server %s@%s:%d connectionId: %ld", connection->user, connection->hostname, connection->port, connection->connectionId))); diff --git a/src/backend/distributed/connection/worker_log_messages.c b/src/backend/distributed/connection/worker_log_messages.c index b822f5e83..9c240620e 100644 --- a/src/backend/distributed/connection/worker_log_messages.c +++ b/src/backend/distributed/connection/worker_log_messages.c @@ -173,7 +173,7 @@ DefaultCitusNoticeReceiver(void *arg, const PGresult *result) ereport(logLevel, (errcode(sqlState), - errmsg("%s", ApplyLogRedaction(trimmedMessage)), + errmsg("%s", trimmedMessage), errdetail("from %s:%d", nodeName, nodePort))); } diff --git a/src/backend/distributed/executor/local_executor.c b/src/backend/distributed/executor/local_executor.c index d0f5b1fa9..ffd063ca0 100644 --- a/src/backend/distributed/executor/local_executor.c +++ b/src/backend/distributed/executor/local_executor.c @@ -519,7 +519,7 @@ LogLocalCommand(Task *task) } ereport(NOTICE, (errmsg("executing the command locally: %s", - ApplyLogRedaction(command)))); + command))); } diff --git a/src/backend/distributed/executor/multi_client_executor.c b/src/backend/distributed/executor/multi_client_executor.c index 64edb2014..ddcdc9a6e 100644 --- a/src/backend/distributed/executor/multi_client_executor.c +++ b/src/backend/distributed/executor/multi_client_executor.c @@ -155,9 +155,9 @@ MultiClientSendQuery(int32 connectionId, const char *query) * we cannot send the queries that Citus itself produced. */ ereport(WARNING, (errmsg("could not send remote query \"%s\"", - ApplyLogRedaction(query)), + query), errdetail("Client error: %s", - ApplyLogRedaction(errorMessage)))); + errorMessage))); success = false; } diff --git a/src/backend/distributed/metadata/metadata_cache.c b/src/backend/distributed/metadata/metadata_cache.c index 83fc33720..810749f75 100644 --- a/src/backend/distributed/metadata/metadata_cache.c +++ b/src/backend/distributed/metadata/metadata_cache.c @@ -2807,42 +2807,6 @@ TextOutFunctionId(void) } -/* - * PgTableVisibleFuncId returns oid of the pg_table_is_visible function. - */ -Oid -PgTableVisibleFuncId(void) -{ - if (MetadataCache.pgTableIsVisibleFuncId == InvalidOid) - { - const int argCount = 1; - - MetadataCache.pgTableIsVisibleFuncId = - FunctionOid("pg_catalog", "pg_table_is_visible", argCount); - } - - return MetadataCache.pgTableIsVisibleFuncId; -} - - -/* - * CitusTableVisibleFuncId returns oid of the citus_table_is_visible function. - */ -Oid -CitusTableVisibleFuncId(void) -{ - if (MetadataCache.citusTableIsVisibleFuncId == InvalidOid) - { - const int argCount = 1; - - MetadataCache.citusTableIsVisibleFuncId = - FunctionOid("pg_catalog", "citus_table_is_visible", argCount); - } - - return MetadataCache.citusTableIsVisibleFuncId; -} - - /* * RelationIsAKnownShardFuncId returns oid of the relation_is_a_known_shard function. */ @@ -4400,17 +4364,6 @@ CitusTableTypeIdList(CitusTableType citusTableType) } -/* - * ClusterHasReferenceTable returns true if the cluster has - * any reference table. - */ -bool -ClusterHasReferenceTable(void) -{ - return list_length(CitusTableTypeIdList(REFERENCE_TABLE)) > 0; -} - - /* * InvalidateNodeRelationCacheCallback destroys the WorkerNodeHash when * any change happens on pg_dist_node table. It also set WorkerNodeHash to diff --git a/src/backend/distributed/metadata/metadata_utility.c b/src/backend/distributed/metadata/metadata_utility.c index ff85f6930..e65e211c6 100644 --- a/src/backend/distributed/metadata/metadata_utility.c +++ b/src/backend/distributed/metadata/metadata_utility.c @@ -2135,21 +2135,6 @@ EnsureTableOwner(Oid relationId) } -/* - * Check that the current user has owner rights to the schema, error out if - * not. Superusers are regarded as owners. - */ -void -EnsureSchemaOwner(Oid schemaId) -{ - if (!pg_namespace_ownercheck(schemaId, GetUserId())) - { - aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_SCHEMA, - get_namespace_name(schemaId)); - } -} - - /* * Check that the current user has owner rights to functionId, error out if * not. Superusers are regarded as owners. Functions and procedures are diff --git a/src/backend/distributed/operations/modify_multiple_shards.c b/src/backend/distributed/operations/modify_multiple_shards.c index ba87108aa..5ed9a5d35 100644 --- a/src/backend/distributed/operations/modify_multiple_shards.c +++ b/src/backend/distributed/operations/modify_multiple_shards.c @@ -78,7 +78,7 @@ master_modify_multiple_shards(PG_FUNCTION_ARGS) if (!IsA(queryTreeNode, DeleteStmt) && !IsA(queryTreeNode, UpdateStmt)) { ereport(ERROR, (errmsg("query \"%s\" is not a delete or update " - "statement", ApplyLogRedaction(queryString)))); + "statement", queryString))); } ereport(WARNING, (errmsg("master_modify_multiple_shards is deprecated and will be " diff --git a/src/backend/distributed/planner/deparse_shard_query.c b/src/backend/distributed/planner/deparse_shard_query.c index 43a493a89..11338df65 100644 --- a/src/backend/distributed/planner/deparse_shard_query.c +++ b/src/backend/distributed/planner/deparse_shard_query.c @@ -137,7 +137,7 @@ RebuildQueryStrings(Job *workerJob) ereport(DEBUG4, (errmsg("query before rebuilding: %s", !isQueryObjectOrText ? "(null)" - : ApplyLogRedaction(TaskQueryString(task))))); + : TaskQueryString(task)))); UpdateTaskQueryString(query, task); @@ -148,7 +148,7 @@ RebuildQueryStrings(Job *workerJob) task->parametersInQueryStringResolved = workerJob->parametersInJobQueryResolved; ereport(DEBUG4, (errmsg("query after rebuilding: %s", - ApplyLogRedaction(TaskQueryString(task))))); + TaskQueryString(task)))); } } diff --git a/src/backend/distributed/planner/insert_select_planner.c b/src/backend/distributed/planner/insert_select_planner.c index 097b2bb81..157e04dc4 100644 --- a/src/backend/distributed/planner/insert_select_planner.c +++ b/src/backend/distributed/planner/insert_select_planner.c @@ -927,7 +927,7 @@ RouterModifyTaskForShardInterval(Query *originalQuery, deparse_shard_query(copiedQuery, distributedTableId, shardInterval->shardId, queryString); ereport(DEBUG2, (errmsg("distributed statement: %s", - ApplyLogRedaction(queryString->data)))); + queryString->data))); Task *modifyTask = CreateBasicTask(jobId, taskIdIndex, MODIFY_TASK, queryString->data); diff --git a/src/backend/distributed/planner/multi_join_order.c b/src/backend/distributed/planner/multi_join_order.c index cdfd94cc5..9b2342b20 100644 --- a/src/backend/distributed/planner/multi_join_order.c +++ b/src/backend/distributed/planner/multi_join_order.c @@ -627,7 +627,7 @@ PrintJoinOrderList(List *joinOrder) } ereport(LOG, (errmsg("join order: %s", - ApplyLogRedaction(printBuffer->data)))); + printBuffer->data))); } diff --git a/src/backend/distributed/planner/multi_physical_planner.c b/src/backend/distributed/planner/multi_physical_planner.c index df1f1bfcb..c664e782f 100644 --- a/src/backend/distributed/planner/multi_physical_planner.c +++ b/src/backend/distributed/planner/multi_physical_planner.c @@ -2566,7 +2566,7 @@ QueryPushdownTaskCreate(Query *originalQuery, int shardIndex, { pg_get_query_def(taskQuery, queryString); ereport(DEBUG4, (errmsg("distributed statement: %s", - ApplyLogRedaction(queryString->data)))); + queryString->data))); SetTaskQueryString(subqueryTask, queryString->data); } @@ -2721,7 +2721,7 @@ SqlTaskList(Job *job) /* log the query string we generated */ ereport(DEBUG4, (errmsg("generated sql query for task %d", sqlTask->taskId), errdetail("query string: \"%s\"", - ApplyLogRedaction(sqlQueryString->data)))); + sqlQueryString->data))); sqlTask->anchorShardId = INVALID_SHARD_ID; if (anchorRangeTableBasedAssignment) @@ -3236,45 +3236,6 @@ BinaryOpExpression(Expr *clause, Node **leftOperand, Node **rightOperand) } -/* - * SimpleOpExpression checks that given expression is a simple operator - * expression. A simple operator expression is a binary operator expression with - * operands of a var and a non-null constant. - */ -bool -SimpleOpExpression(Expr *clause) -{ - Const *constantClause = NULL; - - Node *leftOperand; - Node *rightOperand; - if (!BinaryOpExpression(clause, &leftOperand, &rightOperand)) - { - return false; - } - - if (IsA(rightOperand, Const) && IsA(leftOperand, Var)) - { - constantClause = (Const *) rightOperand; - } - else if (IsA(leftOperand, Const) && IsA(rightOperand, Var)) - { - constantClause = (Const *) leftOperand; - } - else - { - return false; - } - - if (constantClause->constisnull) - { - return false; - } - - return true; -} - - /* * MakeInt4Column creates a column of int4 type with invalid table id and max * attribute number. diff --git a/src/backend/distributed/planner/recursive_planning.c b/src/backend/distributed/planner/recursive_planning.c index 17983c73c..2ebaba829 100644 --- a/src/backend/distributed/planner/recursive_planning.c +++ b/src/backend/distributed/planner/recursive_planning.c @@ -242,7 +242,7 @@ GenerateSubplansForSubqueriesAndCTEs(uint64 planId, Query *originalQuery, ereport(DEBUG1, (errmsg( "Plan " UINT64_FORMAT " query after replacing subqueries and CTEs: %s", planId, - ApplyLogRedaction(subPlanString->data)))); + subPlanString->data))); } recursivePlanningDepth--; @@ -763,7 +763,7 @@ RecursivelyPlanCTEs(Query *query, RecursivePlanningContext *planningContext) ereport(DEBUG1, (errmsg("generating subplan " UINT64_FORMAT "_%u for CTE %s: %s", planId, subPlanId, cteName, - ApplyLogRedaction(subPlanString->data)))); + subPlanString->data))); } /* build a sub plan for the CTE */ @@ -1181,7 +1181,7 @@ RecursivelyPlanSubquery(Query *subquery, RecursivePlanningContext *planningConte ereport(DEBUG1, (errmsg("generating subplan " UINT64_FORMAT "_%u for subquery %s", planId, subPlanId, - ApplyLogRedaction(subqueryString->data)))); + subqueryString->data))); } /* finally update the input subquery to point the result query */ diff --git a/src/backend/distributed/transaction/distributed_deadlock_detection.c b/src/backend/distributed/transaction/distributed_deadlock_detection.c index 5219336a3..cf8dd43f5 100644 --- a/src/backend/distributed/transaction/distributed_deadlock_detection.c +++ b/src/backend/distributed/transaction/distributed_deadlock_detection.c @@ -657,7 +657,7 @@ LogDistributedDeadlockDebugMessage(const char *errorMessage) } ereport(LOG, (errmsg("[%s] %s", timestamptz_to_str(GetCurrentTimestamp()), - ApplyLogRedaction(errorMessage)))); + errorMessage))); } diff --git a/src/backend/distributed/transaction/worker_transaction.c b/src/backend/distributed/transaction/worker_transaction.c index 6b4b1a351..8cce25aca 100644 --- a/src/backend/distributed/transaction/worker_transaction.c +++ b/src/backend/distributed/transaction/worker_transaction.c @@ -44,13 +44,7 @@ static void SendCommandToWorkersParamsInternal(TargetWorkerSet targetWorkerSet, const Oid *parameterTypes, const char *const *parameterValues); static void ErrorIfAnyMetadataNodeOutOfSync(List *metadataNodeList); -static List * OpenConnectionsToWorkersInParallel(TargetWorkerSet targetWorkerSet, - const char *user); -static void GetConnectionsResults(List *connectionList, bool failOnError); -static void SendCommandToWorkersOutsideTransaction(TargetWorkerSet targetWorkerSet, - const char *command, const char *user, - bool - failOnError); + /* * SendCommandToWorker sends a command to a particular worker as part of the @@ -238,129 +232,6 @@ SendCommandToMetadataWorkersParams(const char *command, } -/* - * SendCommandToWorkersOptionalInParallel sends the given command to workers in parallel. - * It does error if there is a problem while sending the query, but it doesn't error - * if there is a problem while executing the query. - */ -void -SendCommandToWorkersOptionalInParallel(TargetWorkerSet targetWorkerSet, const - char *command, - const char *user) -{ - bool failOnError = false; - SendCommandToWorkersOutsideTransaction(targetWorkerSet, command, user, - failOnError); -} - - -/* - * SendCommandToWorkersInParallel sends the given command to workers in parallel. - * It does error if there is a problem while sending the query, it errors if there - * was any problem when sending/receiving. - */ -void -SendCommandToWorkersInParallel(TargetWorkerSet targetWorkerSet, const - char *command, - const char *user) -{ - bool failOnError = true; - SendCommandToWorkersOutsideTransaction(targetWorkerSet, command, user, - failOnError); -} - - -/* - * SendCommandToWorkersOutsideTransaction sends the given command to workers in parallel. - */ -static void -SendCommandToWorkersOutsideTransaction(TargetWorkerSet targetWorkerSet, const - char *command, const char *user, bool - failOnError) -{ - List *connectionList = OpenConnectionsToWorkersInParallel(targetWorkerSet, user); - - /* finish opening connections */ - FinishConnectionListEstablishment(connectionList); - - /* send commands in parallel */ - MultiConnection *connection = NULL; - foreach_ptr(connection, connectionList) - { - int querySent = SendRemoteCommand(connection, command); - if (failOnError && querySent == 0) - { - ReportConnectionError(connection, ERROR); - } - } - - GetConnectionsResults(connectionList, failOnError); -} - - -/* - * OpenConnectionsToWorkersInParallel opens connections to the given target worker set in parallel, - * as the given user. - */ -static List * -OpenConnectionsToWorkersInParallel(TargetWorkerSet targetWorkerSet, const char *user) -{ - List *connectionList = NIL; - - List *workerNodeList = TargetWorkerSetNodeList(targetWorkerSet, RowShareLock); - - WorkerNode *workerNode = NULL; - foreach_ptr(workerNode, workerNodeList) - { - const char *nodeName = workerNode->workerName; - int nodePort = workerNode->workerPort; - int32 connectionFlags = OUTSIDE_TRANSACTION; - - MultiConnection *connection = StartNodeUserDatabaseConnection(connectionFlags, - nodeName, nodePort, - user, NULL); - - /* - * connection can only be NULL for optional connections, which we don't - * support in this codepath. - */ - Assert((connectionFlags & OPTIONAL_CONNECTION) == 0); - Assert(connection != NULL); - connectionList = lappend(connectionList, connection); - } - return connectionList; -} - - -/* - * GetConnectionsResults gets remote command results - * for the given connections. It raises any error if failOnError is true. - */ -static void -GetConnectionsResults(List *connectionList, bool failOnError) -{ - MultiConnection *connection = NULL; - foreach_ptr(connection, connectionList) - { - bool raiseInterrupt = false; - PGresult *result = GetRemoteCommandResult(connection, raiseInterrupt); - - bool isResponseOK = result != NULL && IsResponseOK(result); - if (failOnError && !isResponseOK) - { - ReportResultError(connection, result, ERROR); - } - - PQclear(result); - - if (isResponseOK) - { - ForgetResults(connection); - } - } -} - - /* * SendCommandToWorkersParamsInternal sends a command to all workers in parallel. * Commands are committed on the workers when the local transaction commits. The diff --git a/src/backend/distributed/utils/directory.c b/src/backend/distributed/utils/directory.c index 4797c50ee..b749b9cd6 100644 --- a/src/backend/distributed/utils/directory.c +++ b/src/backend/distributed/utils/directory.c @@ -22,35 +22,6 @@ static bool FileIsLink(const char *filename, struct stat filestat); -/* - * CacheDirectoryElement takes in a filename, and checks if this name lives in - * the directory path that is used for job, task, table etc. files. - */ -bool -CacheDirectoryElement(const char *filename) -{ - bool directoryElement = false; - - StringInfo directoryPath = makeStringInfo(); - appendStringInfo(directoryPath, "base/%s/", PG_JOB_CACHE_DIR); - - char *directoryPathFound = strstr(filename, directoryPath->data); - - /* - * If directoryPath occurs at the beginning of the filename, then the - * pointers should now be equal. - */ - if (directoryPathFound == filename) - { - directoryElement = true; - } - - pfree(directoryPath); - - return directoryElement; -} - - /* * CitusCreateDirectory creates a new directory with the given directory name. */ diff --git a/src/backend/distributed/utils/log_utils.c b/src/backend/distributed/utils/log_utils.c index 97c8a6976..ed463c40a 100644 --- a/src/backend/distributed/utils/log_utils.c +++ b/src/backend/distributed/utils/log_utils.c @@ -39,14 +39,3 @@ IsLoggableLevel(int logLevel) { return log_min_messages <= logLevel || client_min_messages <= logLevel; } - - -/* - * HashLogMessage is deprecated and doesn't do anything anymore. Its indirect - * usage will be removed later. - */ -char * -HashLogMessage(const char *logText) -{ - return (char *) logText; -} diff --git a/src/backend/distributed/worker/worker_data_fetch_protocol.c b/src/backend/distributed/worker/worker_data_fetch_protocol.c index cbc7af89a..f7dd8e489 100644 --- a/src/backend/distributed/worker/worker_data_fetch_protocol.c +++ b/src/backend/distributed/worker/worker_data_fetch_protocol.c @@ -431,7 +431,7 @@ ParseTreeRawStmt(const char *ddlCommand) /* log immediately if dictated by log statement */ if (check_log_statement(parseTreeList)) { - ereport(LOG, (errmsg("statement: %s", ApplyLogRedaction(ddlCommand)), + ereport(LOG, (errmsg("statement: %s", ddlCommand), errhidestmt(true))); } diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 776365666..d5dedadaa 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -264,7 +264,6 @@ extern List * GetForeignConstraintFromDistributedTablesCommands(Oid relationId); extern List * GetForeignConstraintCommandsInternal(Oid relationId, int flags); extern bool AnyForeignKeyDependsOnIndex(Oid indexId); extern bool HasForeignKeyWithLocalTable(Oid relationId); -extern bool HasForeignKeyToCitusLocalTable(Oid relationId); extern bool HasForeignKeyToReferenceTable(Oid relationOid); extern List * GetForeignKeysFromLocalTables(Oid relationId); extern bool TableReferenced(Oid relationOid); diff --git a/src/include/distributed/commands/utility_hook.h b/src/include/distributed/commands/utility_hook.h index b0b55a2cd..7229f7c72 100644 --- a/src/include/distributed/commands/utility_hook.h +++ b/src/include/distributed/commands/utility_hook.h @@ -104,7 +104,4 @@ extern void ResetConstraintDropped(void); extern void ExecuteDistributedDDLJob(DDLJob *ddlJob); extern void ColumnarTableSetOptionsHook(Oid relationId, ColumnarOptions options); -/* forward declarations for sending custom commands to a distributed table */ -extern DDLJob * CreateCustomDDLTaskList(Oid relationId, TableDDLCommand *command); - #endif /* MULTI_UTILITY_H */ diff --git a/src/include/distributed/log_utils.h b/src/include/distributed/log_utils.h index ceddfc838..a9333a8a3 100644 --- a/src/include/distributed/log_utils.h +++ b/src/include/distributed/log_utils.h @@ -19,10 +19,6 @@ extern bool EnableUnsupportedFeatureMessages; extern bool IsLoggableLevel(int logLevel); -extern char * HashLogMessage(const char *text); - -#define ApplyLogRedaction(text) \ - (log_min_messages <= ereport_loglevel ? HashLogMessage(text) : text) #undef ereport diff --git a/src/include/distributed/metadata_cache.h b/src/include/distributed/metadata_cache.h index 92f8a4514..0e9952e2d 100644 --- a/src/include/distributed/metadata_cache.h +++ b/src/include/distributed/metadata_cache.h @@ -180,7 +180,6 @@ extern void FlushDistTableCache(void); extern void InvalidateMetadataSystemCache(void); extern List * CitusTableTypeIdList(CitusTableType citusTableType); extern Datum DistNodeMetadata(void); -extern bool ClusterHasReferenceTable(void); extern bool HasUniformHashDistribution(ShardInterval **shardIntervalArray, int shardIntervalArrayLength); extern bool HasUninitializedShardInterval(ShardInterval **sortedShardIntervalArray, @@ -258,8 +257,6 @@ extern Oid CitusExtraDataContainerFuncId(void); extern Oid CitusAnyValueFunctionId(void); extern Oid CitusTextSendAsJsonbFunctionId(void); extern Oid TextOutFunctionId(void); -extern Oid PgTableVisibleFuncId(void); -extern Oid CitusTableVisibleFuncId(void); extern Oid RelationIsAKnownShardFuncId(void); extern Oid JsonbExtractPathFuncId(void); extern Oid JsonbExtractPathTextFuncId(void); diff --git a/src/include/distributed/metadata_utility.h b/src/include/distributed/metadata_utility.h index 56e15d171..7d9d49646 100644 --- a/src/include/distributed/metadata_utility.h +++ b/src/include/distributed/metadata_utility.h @@ -276,7 +276,6 @@ extern Oid TableOwnerOid(Oid relationId); extern char * TableOwner(Oid relationId); extern void EnsureTablePermissions(Oid relationId, AclMode mode); extern void EnsureTableOwner(Oid relationId); -extern void EnsureSchemaOwner(Oid schemaId); extern void EnsureHashDistributedTable(Oid relationId); extern void EnsureFunctionOwner(Oid functionId); extern void EnsureSuperUser(void); diff --git a/src/include/distributed/multi_physical_planner.h b/src/include/distributed/multi_physical_planner.h index 14fdd7a0c..484c8f517 100644 --- a/src/include/distributed/multi_physical_planner.h +++ b/src/include/distributed/multi_physical_planner.h @@ -551,7 +551,6 @@ extern CollateExpr * RelabelTypeToCollateExpr(RelabelType *relabelType); extern Node * BuildBaseConstraint(Var *column); extern void UpdateConstraint(Node *baseConstraint, ShardInterval *shardInterval); extern bool BinaryOpExpression(Expr *clause, Node **leftOperand, Node **rightOperand); -extern bool SimpleOpExpression(Expr *clause); /* helper functions */ extern Var * MakeInt4Column(void); diff --git a/src/include/distributed/utils/directory.h b/src/include/distributed/utils/directory.h index 48294cd00..7ed8a3f95 100644 --- a/src/include/distributed/utils/directory.h +++ b/src/include/distributed/utils/directory.h @@ -18,7 +18,6 @@ #define PG_JOB_CACHE_DIR "pgsql_job_cache" -extern bool CacheDirectoryElement(const char *filename); extern void CleanupJobCacheDirectory(void); extern void CitusCreateDirectory(StringInfo directoryName); extern void CitusRemoveDirectory(const char *filename); diff --git a/src/include/distributed/worker_transaction.h b/src/include/distributed/worker_transaction.h index 72b16acd5..689a9e192 100644 --- a/src/include/distributed/worker_transaction.h +++ b/src/include/distributed/worker_transaction.h @@ -79,11 +79,6 @@ extern void SendMetadataCommandListToWorkerListInCoordinatedTransaction( const char * nodeUser, List *commandList); -extern void SendCommandToWorkersOptionalInParallel(TargetWorkerSet targetWorkerSet, - const char *command, - const char *user); -void SendCommandToWorkersInParallel(TargetWorkerSet targetWorkerSet, - const char *command, const char *user); extern void RemoveWorkerTransaction(const char *nodeName, int32 nodePort); /* helper functions for worker transactions */