mirror of https://github.com/citusdata/citus.git
Merge bcabf9175d into 31911d8297
commit
5b05d44a69
|
|
@ -113,10 +113,10 @@ FROM base AS uncrustify-builder
|
||||||
RUN sudo apt update && sudo apt install -y cmake tree
|
RUN sudo apt update && sudo apt install -y cmake tree
|
||||||
|
|
||||||
WORKDIR /uncrustify
|
WORKDIR /uncrustify
|
||||||
RUN curl -L https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz | tar xz
|
RUN curl -L https://github.com/uncrustify/uncrustify/archive/uncrustify-0.82.0.tar.gz | tar xz
|
||||||
WORKDIR /uncrustify/uncrustify-uncrustify-0.68.1/
|
WORKDIR /uncrustify/uncrustify-uncrustify-0.82.0/
|
||||||
RUN mkdir build
|
RUN mkdir build
|
||||||
WORKDIR /uncrustify/uncrustify-uncrustify-0.68.1/build/
|
WORKDIR /uncrustify/uncrustify-uncrustify-0.82.0/build/
|
||||||
RUN cmake ..
|
RUN cmake ..
|
||||||
RUN MAKEFLAGS="-j $(nproc)" make -s
|
RUN MAKEFLAGS="-j $(nproc)" make -s
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
style_checker_image_name: "ghcr.io/citusdata/stylechecker"
|
style_checker_image_name: "ghcr.io/citusdata/stylechecker"
|
||||||
style_checker_tools_version: "0.8.18"
|
style_checker_tools_version: "0.8.18"
|
||||||
sql_snapshot_pg_version: "17.6"
|
sql_snapshot_pg_version: "17.6"
|
||||||
image_suffix: "-va20872f"
|
image_suffix: "-dev-7ba2db1"
|
||||||
pg15_version: '{ "major": "15", "full": "15.14" }'
|
pg15_version: '{ "major": "15", "full": "15.14" }'
|
||||||
pg16_version: '{ "major": "16", "full": "16.10" }'
|
pg16_version: '{ "major": "16", "full": "16.10" }'
|
||||||
pg17_version: '{ "major": "17", "full": "17.6" }'
|
pg17_version: '{ "major": "17", "full": "17.6" }'
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ tool. This tool uses `uncrustify` under the hood.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Uncrustify changes the way it formats code every release a bit. To make sure
|
# Uncrustify changes the way it formats code every release a bit. To make sure
|
||||||
# everyone formats consistently we use version 0.68.1:
|
# everyone formats consistently we use version 0.82.0:
|
||||||
curl -L https://github.com/uncrustify/uncrustify/archive/uncrustify-0.68.1.tar.gz | tar xz
|
curl -L https://github.com/uncrustify/uncrustify/archive/uncrustify-0.82.0.tar.gz | tar xz
|
||||||
cd uncrustify-uncrustify-0.68.1/
|
cd uncrustify-uncrustify-0.82.0/
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ..
|
cmake ..
|
||||||
|
|
|
||||||
|
|
@ -1332,7 +1332,8 @@ ColumnarRelationId(Oid relid, RelFileLocator relfilelocator)
|
||||||
{
|
{
|
||||||
return OidIsValid(relid) ? relid : RelidByRelfilenumber(RelationTablespace_compat(
|
return OidIsValid(relid) ? relid : RelidByRelfilenumber(RelationTablespace_compat(
|
||||||
relfilelocator),
|
relfilelocator),
|
||||||
RelationPhysicalIdentifierNumber_compat(
|
RelationPhysicalIdentifierNumber_compat
|
||||||
|
(
|
||||||
relfilelocator));
|
relfilelocator));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -758,9 +758,11 @@ SnapshotMightSeeUnflushedStripes(Snapshot snapshot)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -547,7 +547,8 @@ ColumnarStorageTruncate(Relation rel, uint64 newDataReservation)
|
||||||
if (!ColumnarLogicalOffsetIsValid(newDataReservation))
|
if (!ColumnarLogicalOffsetIsValid(newDataReservation))
|
||||||
{
|
{
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"attempted to truncate relation %d to invalid logical offset: " UINT64_FORMAT,
|
"attempted to truncate relation %d to invalid logical offset: " UINT64_FORMAT
|
||||||
|
,
|
||||||
rel->rd_id, newDataReservation);
|
rel->rd_id, newDataReservation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2410,10 +2410,11 @@ ColumnarProcessUtility(PlannedStmt *pstmt,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
/* FALL THROUGH */
|
/* FALL THROUGH */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (columnarOptions != NIL && columnarRangeVar == NULL)
|
if (columnarOptions != NIL && columnarRangeVar == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -185,8 +185,8 @@ typedef struct TableConversionState
|
||||||
|
|
||||||
|
|
||||||
static TableConversionReturn * AlterDistributedTable(TableConversionParameters *params);
|
static TableConversionReturn * AlterDistributedTable(TableConversionParameters *params);
|
||||||
static TableConversionReturn * AlterTableSetAccessMethod(
|
static TableConversionReturn * AlterTableSetAccessMethod(TableConversionParameters *params
|
||||||
TableConversionParameters *params);
|
);
|
||||||
static TableConversionReturn * ConvertTable(TableConversionState *con);
|
static TableConversionReturn * ConvertTable(TableConversionState *con);
|
||||||
static TableConversionReturn * ConvertTableInternal(TableConversionState *con);
|
static TableConversionReturn * ConvertTableInternal(TableConversionState *con);
|
||||||
static bool SwitchToSequentialAndLocalExecutionIfShardNameTooLong(char *relationName,
|
static bool SwitchToSequentialAndLocalExecutionIfShardNameTooLong(char *relationName,
|
||||||
|
|
@ -216,7 +216,8 @@ static void ErrorIfMatViewSizeExceedsTheLimit(Oid matViewOid);
|
||||||
static char * CreateMaterializedViewDDLCommand(Oid matViewOid);
|
static char * CreateMaterializedViewDDLCommand(Oid matViewOid);
|
||||||
static char * GetAccessMethodForMatViewIfExists(Oid viewOid);
|
static char * GetAccessMethodForMatViewIfExists(Oid viewOid);
|
||||||
static bool WillRecreateForeignKeyToReferenceTable(Oid relationId,
|
static bool WillRecreateForeignKeyToReferenceTable(Oid relationId,
|
||||||
CascadeToColocatedOption cascadeOption);
|
CascadeToColocatedOption cascadeOption)
|
||||||
|
;
|
||||||
static void WarningsForDroppingForeignKeysWithDistributedTables(Oid relationId);
|
static void WarningsForDroppingForeignKeysWithDistributedTables(Oid relationId);
|
||||||
static void ErrorIfUnsupportedCascadeObjects(Oid relationId);
|
static void ErrorIfUnsupportedCascadeObjects(Oid relationId);
|
||||||
static List * WrapTableDDLCommands(List *commandStrings);
|
static List * WrapTableDDLCommands(List *commandStrings);
|
||||||
|
|
@ -506,7 +507,8 @@ UndistributeTable(TableConversionParameters *params)
|
||||||
IsCitusTableType(params->relationId, SINGLE_SHARD_DISTRIBUTED))
|
IsCitusTableType(params->relationId, SINGLE_SHARD_DISTRIBUTED))
|
||||||
{
|
{
|
||||||
EnsureUndistributeTenantTableSafe(params->relationId,
|
EnsureUndistributeTenantTableSafe(params->relationId,
|
||||||
TenantOperationNames[TENANT_UNDISTRIBUTE_TABLE]);
|
TenantOperationNames[TENANT_UNDISTRIBUTE_TABLE])
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!params->cascadeViaForeignKeys)
|
if (!params->cascadeViaForeignKeys)
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS
|
||||||
return NIL;
|
return NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ops->qualify && DistOpsValidityState(stmt, ops) ==
|
if (ops->qualify && DistOpsValidityState(stmt, ops) == ShouldQualifyAfterLocalCreation
|
||||||
ShouldQualifyAfterLocalCreation)
|
)
|
||||||
{
|
{
|
||||||
/* qualify the statement after local creation */
|
/* qualify the statement after local creation */
|
||||||
ops->qualify(stmt);
|
ops->qualify(stmt);
|
||||||
|
|
|
||||||
|
|
@ -703,7 +703,8 @@ EnsureColocateWithTableIsValid(Oid relationId, char distributionMethod,
|
||||||
* the relation because the distribution column can be modified in that period.
|
* the relation because the distribution column can be modified in that period.
|
||||||
*/
|
*/
|
||||||
Oid distributionColumnType = ColumnTypeIdForRelationColumnName(relationId,
|
Oid distributionColumnType = ColumnTypeIdForRelationColumnName(relationId,
|
||||||
distributionColumnName);
|
distributionColumnName)
|
||||||
|
;
|
||||||
|
|
||||||
text *colocateWithTableNameText = cstring_to_text(colocateWithTableName);
|
text *colocateWithTableNameText = cstring_to_text(colocateWithTableName);
|
||||||
Oid colocateWithTableId = ResolveRelationId(colocateWithTableNameText, false);
|
Oid colocateWithTableId = ResolveRelationId(colocateWithTableNameText, false);
|
||||||
|
|
@ -1108,8 +1109,8 @@ CreateCitusTable(Oid relationId, CitusTableType tableType,
|
||||||
DistributedTableParams *distributedTableParams)
|
DistributedTableParams *distributedTableParams)
|
||||||
{
|
{
|
||||||
if ((tableType == HASH_DISTRIBUTED || tableType == APPEND_DISTRIBUTED ||
|
if ((tableType == HASH_DISTRIBUTED || tableType == APPEND_DISTRIBUTED ||
|
||||||
tableType == RANGE_DISTRIBUTED || tableType == SINGLE_SHARD_DISTRIBUTED) !=
|
tableType == RANGE_DISTRIBUTED || tableType == SINGLE_SHARD_DISTRIBUTED) != (
|
||||||
(distributedTableParams != NULL))
|
distributedTableParams != NULL))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("distributed table params must be provided "
|
ereport(ERROR, (errmsg("distributed table params must be provided "
|
||||||
"when creating a distributed table and must "
|
"when creating a distributed table and must "
|
||||||
|
|
|
||||||
|
|
@ -2165,9 +2165,11 @@ GetDistributeObjectOps(Node *node)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return &Any_SecLabel;
|
return &Any_SecLabel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case T_RenameStmt:
|
case T_RenameStmt:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,8 @@ static void DistributeFunctionColocatedWithDistributedTable(RegProcedure funcOid
|
||||||
const ObjectAddress *
|
const ObjectAddress *
|
||||||
functionAddress);
|
functionAddress);
|
||||||
static void DistributeFunctionColocatedWithSingleShardTable(const
|
static void DistributeFunctionColocatedWithSingleShardTable(const
|
||||||
ObjectAddress *functionAddress,
|
ObjectAddress *functionAddress
|
||||||
|
,
|
||||||
text *colocateWithText);
|
text *colocateWithText);
|
||||||
static void DistributeFunctionColocatedWithReferenceTable(const
|
static void DistributeFunctionColocatedWithReferenceTable(const
|
||||||
ObjectAddress *functionAddress);
|
ObjectAddress *functionAddress);
|
||||||
|
|
@ -1896,9 +1897,11 @@ ShouldAddFunctionSignature(FunctionParameterMode mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -227,8 +227,8 @@ CollectGrantTableIdList(GrantStmt *grantStmt)
|
||||||
|
|
||||||
bool grantOnTableCommand = (grantStmt->targtype == ACL_TARGET_OBJECT &&
|
bool grantOnTableCommand = (grantStmt->targtype == ACL_TARGET_OBJECT &&
|
||||||
grantStmt->objtype == OBJECT_TABLE);
|
grantStmt->objtype == OBJECT_TABLE);
|
||||||
bool grantAllTablesOnSchemaCommand = (grantStmt->targtype ==
|
bool grantAllTablesOnSchemaCommand = (grantStmt->targtype == ACL_TARGET_ALL_IN_SCHEMA
|
||||||
ACL_TARGET_ALL_IN_SCHEMA &&
|
&&
|
||||||
grantStmt->objtype == OBJECT_TABLE);
|
grantStmt->objtype == OBJECT_TABLE);
|
||||||
|
|
||||||
/* we are only interested in table level grants */
|
/* we are only interested in table level grants */
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,8 @@ static int GetNumberOfIndexParameters(IndexStmt *createIndexStatement);
|
||||||
static bool IndexAlreadyExists(IndexStmt *createIndexStatement);
|
static bool IndexAlreadyExists(IndexStmt *createIndexStatement);
|
||||||
static Oid CreateIndexStmtGetIndexId(IndexStmt *createIndexStatement);
|
static Oid CreateIndexStmtGetIndexId(IndexStmt *createIndexStatement);
|
||||||
static Oid CreateIndexStmtGetSchemaId(IndexStmt *createIndexStatement);
|
static Oid CreateIndexStmtGetSchemaId(IndexStmt *createIndexStatement);
|
||||||
static void SwitchToSequentialAndLocalExecutionIfIndexNameTooLong(
|
static void SwitchToSequentialAndLocalExecutionIfIndexNameTooLong(IndexStmt *
|
||||||
IndexStmt *createIndexStatement);
|
createIndexStatement);
|
||||||
static char * GenerateLongestShardPartitionIndexName(IndexStmt *createIndexStatement);
|
static char * GenerateLongestShardPartitionIndexName(IndexStmt *createIndexStatement);
|
||||||
static char * GenerateDefaultIndexName(IndexStmt *createIndexStatement);
|
static char * GenerateDefaultIndexName(IndexStmt *createIndexStatement);
|
||||||
static List * GenerateIndexParameters(IndexStmt *createIndexStatement);
|
static List * GenerateIndexParameters(IndexStmt *createIndexStatement);
|
||||||
|
|
|
||||||
|
|
@ -1272,9 +1272,11 @@ ConversionPathForTypes(Oid inputType, Oid destType, CopyCoercionData *result)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
Assert(false); /* there are no other options for this enum */
|
Assert(false); /* there are no other options for this enum */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2859,7 +2861,8 @@ ErrorIfCopyHasOnErrorLogVerbosity(CopyStmt *copyStatement)
|
||||||
if (strcmp(option->defname, "on_error") == 0)
|
if (strcmp(option->defname, "on_error") == 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"Citus does not support COPY FROM with ON_ERROR option.")));
|
"Citus does not support COPY FROM with ON_ERROR option."))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else if (strcmp(option->defname, "log_verbosity") == 0)
|
else if (strcmp(option->defname, "log_verbosity") == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -2877,7 +2880,8 @@ ErrorIfCopyHasOnErrorLogVerbosity(CopyStmt *copyStatement)
|
||||||
if (log_verbosity)
|
if (log_verbosity)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"Citus does not support COPY FROM with LOG_VERBOSITY option.")));
|
"Citus does not support COPY FROM with LOG_VERBOSITY option.")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ PreprocessRenameStmt(Node *node, const char *renameCommand,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Nodes that are not supported by Citus: we pass-through to the
|
* Nodes that are not supported by Citus: we pass-through to the
|
||||||
* main PostgreSQL executor. Any Citus-supported RenameStmt
|
* main PostgreSQL executor. Any Citus-supported RenameStmt
|
||||||
|
|
@ -157,6 +157,7 @@ PreprocessRenameStmt(Node *node, const char *renameCommand,
|
||||||
*/
|
*/
|
||||||
return NIL;
|
return NIL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool isCitusRelation = IsCitusTable(tableRelationId);
|
bool isCitusRelation = IsCitusTable(tableRelationId);
|
||||||
if (!isCitusRelation)
|
if (!isCitusRelation)
|
||||||
|
|
|
||||||
|
|
@ -463,7 +463,8 @@ PreprocessAlterSequenceStmt(Node *node, const char *queryString,
|
||||||
DEPENDENCY_INTERNAL))
|
DEPENDENCY_INTERNAL))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"Altering a distributed sequence is currently not supported.")));
|
"Altering a distributed sequence is currently not supported.")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -991,8 +992,8 @@ FilterDistributedSequences(GrantStmt *stmt)
|
||||||
{
|
{
|
||||||
bool grantOnSequenceCommand = (stmt->targtype == ACL_TARGET_OBJECT &&
|
bool grantOnSequenceCommand = (stmt->targtype == ACL_TARGET_OBJECT &&
|
||||||
stmt->objtype == OBJECT_SEQUENCE);
|
stmt->objtype == OBJECT_SEQUENCE);
|
||||||
bool grantOnAllSequencesInSchemaCommand = (stmt->targtype ==
|
bool grantOnAllSequencesInSchemaCommand = (stmt->targtype == ACL_TARGET_ALL_IN_SCHEMA
|
||||||
ACL_TARGET_ALL_IN_SCHEMA &&
|
&&
|
||||||
stmt->objtype == OBJECT_SEQUENCE);
|
stmt->objtype == OBJECT_SEQUENCE);
|
||||||
|
|
||||||
/* we are only interested in sequence level grants */
|
/* we are only interested in sequence level grants */
|
||||||
|
|
@ -1036,7 +1037,8 @@ FilterDistributedSequences(GrantStmt *stmt)
|
||||||
RangeVar *distributedSequence = makeRangeVar(get_namespace_name(
|
RangeVar *distributedSequence = makeRangeVar(get_namespace_name(
|
||||||
namespaceOid),
|
namespaceOid),
|
||||||
get_rel_name(
|
get_rel_name(
|
||||||
sequenceAddress->objectId),
|
sequenceAddress->objectId
|
||||||
|
),
|
||||||
-1);
|
-1);
|
||||||
grantSequenceList = lappend(grantSequenceList, distributedSequence);
|
grantSequenceList = lappend(grantSequenceList, distributedSequence);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -237,9 +237,11 @@ AcquireCitusAdvisoryObjectClassLockGetOid(ObjectClass objectClass,
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
elog(ERROR, "unsupported object class: %d", objectClass);
|
elog(ERROR, "unsupported object class: %d", objectClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -270,6 +272,8 @@ AcquireCitusAdvisoryObjectClassLockCheckPrivileges(ObjectClass objectClass, Oid
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
elog(ERROR, "unsupported object class: %d", objectClass);
|
elog(ERROR, "unsupported object class: %d", objectClass);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,23 +81,23 @@ static void ErrorIfAttachCitusTableToPgLocalTable(Oid parentRelationId,
|
||||||
Oid partitionRelationId);
|
Oid partitionRelationId);
|
||||||
static bool DeparserSupportsAlterTableAddColumn(AlterTableStmt *alterTableStatement,
|
static bool DeparserSupportsAlterTableAddColumn(AlterTableStmt *alterTableStatement,
|
||||||
AlterTableCmd *addColumnSubCommand);
|
AlterTableCmd *addColumnSubCommand);
|
||||||
static bool ATDefinesFKeyBetweenPostgresAndCitusLocalOrRef(
|
static bool ATDefinesFKeyBetweenPostgresAndCitusLocalOrRef(AlterTableStmt *
|
||||||
AlterTableStmt *alterTableStatement);
|
alterTableStatement);
|
||||||
static bool ShouldMarkConnectedRelationsNotAutoConverted(Oid leftRelationId,
|
static bool ShouldMarkConnectedRelationsNotAutoConverted(Oid leftRelationId,
|
||||||
Oid rightRelationId);
|
Oid rightRelationId);
|
||||||
static bool RelationIdListContainsCitusTableType(List *relationIdList,
|
static bool RelationIdListContainsCitusTableType(List *relationIdList,
|
||||||
CitusTableType citusTableType);
|
CitusTableType citusTableType);
|
||||||
static bool RelationIdListContainsPostgresTable(List *relationIdList);
|
static bool RelationIdListContainsPostgresTable(List *relationIdList);
|
||||||
static void ConvertPostgresLocalTablesToCitusLocalTables(
|
static void ConvertPostgresLocalTablesToCitusLocalTables(AlterTableStmt *
|
||||||
AlterTableStmt *alterTableStatement);
|
alterTableStatement);
|
||||||
static bool RangeVarListHasLocalRelationConvertedByUser(List *relationRangeVarList,
|
static bool RangeVarListHasLocalRelationConvertedByUser(List *relationRangeVarList,
|
||||||
AlterTableStmt *
|
AlterTableStmt *
|
||||||
alterTableStatement);
|
alterTableStatement);
|
||||||
static int CompareRangeVarsByOid(const void *leftElement, const void *rightElement);
|
static int CompareRangeVarsByOid(const void *leftElement, const void *rightElement);
|
||||||
static List * GetAlterTableAddFKeyRightRelationIdList(
|
static List * GetAlterTableAddFKeyRightRelationIdList(AlterTableStmt *alterTableStatement)
|
||||||
AlterTableStmt *alterTableStatement);
|
;
|
||||||
static List * GetAlterTableAddFKeyRightRelationRangeVarList(
|
static List * GetAlterTableAddFKeyRightRelationRangeVarList(AlterTableStmt *
|
||||||
AlterTableStmt *alterTableStatement);
|
alterTableStatement);
|
||||||
static List * GetAlterTableAddFKeyConstraintList(AlterTableStmt *alterTableStatement);
|
static List * GetAlterTableAddFKeyConstraintList(AlterTableStmt *alterTableStatement);
|
||||||
static List * GetAlterTableCommandFKeyConstraintList(AlterTableCmd *command);
|
static List * GetAlterTableCommandFKeyConstraintList(AlterTableCmd *command);
|
||||||
static List * GetRangeVarListFromFKeyConstraintList(List *fKeyConstraintList);
|
static List * GetRangeVarListFromFKeyConstraintList(List *fKeyConstraintList);
|
||||||
|
|
@ -2181,9 +2181,11 @@ AlterTableCommandTypeIsTrigger(AlterTableType alterTableType)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -3426,7 +3428,8 @@ ErrorIfUnsupportedAlterTableStmt(AlterTableStmt *alterTableStatement)
|
||||||
columnConstraints->length > 1)
|
columnConstraints->length > 1)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(
|
ereport(ERROR, (errcode(
|
||||||
ERRCODE_FEATURE_NOT_SUPPORTED),
|
ERRCODE_FEATURE_NOT_SUPPORTED)
|
||||||
|
,
|
||||||
errmsg(
|
errmsg(
|
||||||
"cannot execute ADD COLUMN .. DEFAULT nextval('..')"
|
"cannot execute ADD COLUMN .. DEFAULT nextval('..')"
|
||||||
" command with other subcommands/constraints"),
|
" command with other subcommands/constraints"),
|
||||||
|
|
@ -3441,7 +3444,8 @@ ErrorIfUnsupportedAlterTableStmt(AlterTableStmt *alterTableStatement)
|
||||||
if (!TableEmpty(relationId))
|
if (!TableEmpty(relationId))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(
|
ereport(ERROR, (errcode(
|
||||||
ERRCODE_FEATURE_NOT_SUPPORTED),
|
ERRCODE_FEATURE_NOT_SUPPORTED)
|
||||||
|
,
|
||||||
errmsg(
|
errmsg(
|
||||||
"cannot add a column involving DEFAULT nextval('..') "
|
"cannot add a column involving DEFAULT nextval('..') "
|
||||||
"because the table is not empty"),
|
"because the table is not empty"),
|
||||||
|
|
|
||||||
|
|
@ -1297,7 +1297,8 @@ ExecuteDistributedDDLJob(DDLJob *ddlJob)
|
||||||
"partial failure, potentially leading to an inconsistent "
|
"partial failure, potentially leading to an inconsistent "
|
||||||
"state.\nIf the problematic command is a CREATE operation, "
|
"state.\nIf the problematic command is a CREATE operation, "
|
||||||
"consider using the 'IF EXISTS' syntax to drop the object,"
|
"consider using the 'IF EXISTS' syntax to drop the object,"
|
||||||
"\nif applicable, and then re-attempt the original command.")));
|
"\nif applicable, and then re-attempt the original command.")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
PG_RE_THROW();
|
PG_RE_THROW();
|
||||||
|
|
|
||||||
|
|
@ -475,8 +475,8 @@ FindAvailableConnection(dlist_head *connections, uint32 flags)
|
||||||
if (flags & OUTSIDE_TRANSACTION)
|
if (flags & OUTSIDE_TRANSACTION)
|
||||||
{
|
{
|
||||||
/* don't return connections that are used in transactions */
|
/* don't return connections that are used in transactions */
|
||||||
if (connection->remoteTransaction.transactionState !=
|
if (connection->remoteTransaction.transactionState != REMOTE_TRANS_NOT_STARTED
|
||||||
REMOTE_TRANS_NOT_STARTED)
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,8 +191,8 @@ static HTAB *ConnectionShardHash;
|
||||||
|
|
||||||
static MultiConnection * FindPlacementListConnection(int flags, List *placementAccessList,
|
static MultiConnection * FindPlacementListConnection(int flags, List *placementAccessList,
|
||||||
const char *userName);
|
const char *userName);
|
||||||
static ConnectionPlacementHashEntry * FindOrCreatePlacementEntry(
|
static ConnectionPlacementHashEntry * FindOrCreatePlacementEntry(ShardPlacement *placement
|
||||||
ShardPlacement *placement);
|
);
|
||||||
static bool CanUseExistingConnection(uint32 flags, const char *userName,
|
static bool CanUseExistingConnection(uint32 flags, const char *userName,
|
||||||
ConnectionReference *placementConnection);
|
ConnectionReference *placementConnection);
|
||||||
static bool ConnectionAccessedDifferentPlacement(MultiConnection *connection,
|
static bool ConnectionAccessedDifferentPlacement(MultiConnection *connection,
|
||||||
|
|
|
||||||
|
|
@ -676,7 +676,8 @@ SharedConnectionStatsShmemInit(void)
|
||||||
ConnectionStatsSharedState->sharedConnectionHashTrancheName =
|
ConnectionStatsSharedState->sharedConnectionHashTrancheName =
|
||||||
"Shared Connection Tracking Hash Tranche";
|
"Shared Connection Tracking Hash Tranche";
|
||||||
LWLockRegisterTranche(ConnectionStatsSharedState->sharedConnectionHashTrancheId,
|
LWLockRegisterTranche(ConnectionStatsSharedState->sharedConnectionHashTrancheId,
|
||||||
ConnectionStatsSharedState->sharedConnectionHashTrancheName);
|
ConnectionStatsSharedState->sharedConnectionHashTrancheName)
|
||||||
|
;
|
||||||
|
|
||||||
LWLockInitialize(&ConnectionStatsSharedState->sharedConnectionHashLock,
|
LWLockInitialize(&ConnectionStatsSharedState->sharedConnectionHashLock,
|
||||||
ConnectionStatsSharedState->sharedConnectionHashTrancheId);
|
ConnectionStatsSharedState->sharedConnectionHashTrancheId);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ static void AppendCreateExtensionStmtOptions(StringInfo buf, List *options);
|
||||||
static void AppendDropExtensionStmt(StringInfo buf, DropStmt *stmt);
|
static void AppendDropExtensionStmt(StringInfo buf, DropStmt *stmt);
|
||||||
static void AppendExtensionNameList(StringInfo buf, List *objects);
|
static void AppendExtensionNameList(StringInfo buf, List *objects);
|
||||||
static void AppendAlterExtensionSchemaStmt(StringInfo buf,
|
static void AppendAlterExtensionSchemaStmt(StringInfo buf,
|
||||||
AlterObjectSchemaStmt *alterExtensionSchemaStmt);
|
AlterObjectSchemaStmt *alterExtensionSchemaStmt
|
||||||
|
);
|
||||||
static void AppendAlterExtensionStmt(StringInfo buf,
|
static void AppendAlterExtensionStmt(StringInfo buf,
|
||||||
AlterExtensionStmt *alterExtensionStmt);
|
AlterExtensionStmt *alterExtensionStmt);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -290,9 +290,11 @@ GetDefElemActionString(DefElemAction action)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -118,10 +118,12 @@ ObjectTypeToKeyword(ObjectType objtype)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
elog(ERROR, "Unknown object type: %d", objtype);
|
elog(ERROR, "Unknown object type: %d", objtype);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,8 @@ AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
errmsg(
|
errmsg(
|
||||||
"only simple column references are allowed in CREATE STATISTICS")));
|
"only simple column references are allowed in CREATE STATISTICS")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *columnName = quote_identifier(column->name);
|
const char *columnName = quote_identifier(column->name);
|
||||||
|
|
|
||||||
|
|
@ -536,10 +536,12 @@ GeneratedWhenStr(char generatedWhen)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ereport(ERROR, (errmsg("unrecognized generated_when: %d",
|
ereport(ERROR, (errmsg("unrecognized generated_when: %d",
|
||||||
generatedWhen)));
|
generatedWhen)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -646,7 +646,8 @@ static TransactionProperties DecideTransactionPropertiesForTaskList(RowModifyLev
|
||||||
modLevel,
|
modLevel,
|
||||||
List *taskList,
|
List *taskList,
|
||||||
bool
|
bool
|
||||||
exludeFromTransaction);
|
exludeFromTransaction)
|
||||||
|
;
|
||||||
static void StartDistributedExecution(DistributedExecution *execution);
|
static void StartDistributedExecution(DistributedExecution *execution);
|
||||||
static void RunLocalExecution(CitusScanState *scanState, DistributedExecution *execution);
|
static void RunLocalExecution(CitusScanState *scanState, DistributedExecution *execution);
|
||||||
static void RunDistributedExecution(DistributedExecution *execution);
|
static void RunDistributedExecution(DistributedExecution *execution);
|
||||||
|
|
@ -711,8 +712,8 @@ static void PlacementExecutionReady(TaskPlacementExecution *placementExecution);
|
||||||
static TaskExecutionState TaskExecutionStateMachine(ShardCommandExecution *
|
static TaskExecutionState TaskExecutionStateMachine(ShardCommandExecution *
|
||||||
shardCommandExecution);
|
shardCommandExecution);
|
||||||
static int GetEventSetSize(List *sessionList);
|
static int GetEventSetSize(List *sessionList);
|
||||||
static bool ProcessSessionsWithFailedWaitEventSetOperations(
|
static bool ProcessSessionsWithFailedWaitEventSetOperations(DistributedExecution *
|
||||||
DistributedExecution *execution);
|
execution);
|
||||||
static bool HasIncompleteConnectionEstablishment(DistributedExecution *execution);
|
static bool HasIncompleteConnectionEstablishment(DistributedExecution *execution);
|
||||||
static void RebuildWaitEventSet(DistributedExecution *execution);
|
static void RebuildWaitEventSet(DistributedExecution *execution);
|
||||||
static void RebuildWaitEventSetForSessions(DistributedExecution *execution);
|
static void RebuildWaitEventSetForSessions(DistributedExecution *execution);
|
||||||
|
|
@ -2635,8 +2636,10 @@ OpenNewConnections(WorkerPool *workerPool, int newConnectionCount,
|
||||||
|
|
||||||
/* open a new connection to the worker */
|
/* open a new connection to the worker */
|
||||||
MultiConnection *connection = StartNodeUserDatabaseConnection(connectionFlags,
|
MultiConnection *connection = StartNodeUserDatabaseConnection(connectionFlags,
|
||||||
workerPool->nodeName,
|
workerPool->nodeName
|
||||||
workerPool->nodePort,
|
,
|
||||||
|
workerPool->nodePort
|
||||||
|
,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (!connection)
|
if (!connection)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,8 @@ static void CitusPreExecScan(CitusScanState *scanState);
|
||||||
static bool ModifyJobNeedsEvaluation(Job *workerJob);
|
static bool ModifyJobNeedsEvaluation(Job *workerJob);
|
||||||
static void RegenerateTaskForFasthPathQuery(Job *workerJob);
|
static void RegenerateTaskForFasthPathQuery(Job *workerJob);
|
||||||
static void RegenerateTaskListForInsert(Job *workerJob);
|
static void RegenerateTaskListForInsert(Job *workerJob);
|
||||||
static DistributedPlan * CopyDistributedPlanWithoutCache(
|
static DistributedPlan * CopyDistributedPlanWithoutCache(DistributedPlan *
|
||||||
DistributedPlan *originalDistributedPlan);
|
originalDistributedPlan);
|
||||||
static void CitusEndScan(CustomScanState *node);
|
static void CitusEndScan(CustomScanState *node);
|
||||||
static void CitusReScan(CustomScanState *node);
|
static void CitusReScan(CustomScanState *node);
|
||||||
static void EnsureForceDelegationDistributionKey(Job *job);
|
static void EnsureForceDelegationDistributionKey(Job *job);
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ static List * WrapTasksForPartitioning(const char *resultIdPrefix,
|
||||||
bool binaryFormat);
|
bool binaryFormat);
|
||||||
static List * ExecutePartitionTaskList(List *partitionTaskList,
|
static List * ExecutePartitionTaskList(List *partitionTaskList,
|
||||||
CitusTableCacheEntry *targetRelation);
|
CitusTableCacheEntry *targetRelation);
|
||||||
static PartitioningTupleDest * CreatePartitioningTupleDest(
|
static PartitioningTupleDest * CreatePartitioningTupleDest(CitusTableCacheEntry *
|
||||||
CitusTableCacheEntry *targetRelation);
|
targetRelation);
|
||||||
static void PartitioningTupleDestPutTuple(TupleDestination *self, Task *task,
|
static void PartitioningTupleDestPutTuple(TupleDestination *self, Task *task,
|
||||||
int placementIndex, int queryNumber,
|
int placementIndex, int queryNumber,
|
||||||
HeapTuple heapTuple, uint64 tupleLibpqSize);
|
HeapTuple heapTuple, uint64 tupleLibpqSize);
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ static HTAB * ExecutePlanIntoColocatedIntermediateResults(Oid targetRelationId,
|
||||||
List *insertTargetList,
|
List *insertTargetList,
|
||||||
PlannedStmt *selectPlan,
|
PlannedStmt *selectPlan,
|
||||||
EState *executorState,
|
EState *executorState,
|
||||||
char *intermediateResultIdPrefix);
|
char *intermediateResultIdPrefix
|
||||||
|
);
|
||||||
static int PartitionColumnIndexFromColumnList(Oid relationId, List *columnNameList);
|
static int PartitionColumnIndexFromColumnList(Oid relationId, List *columnNameList);
|
||||||
static void WrapTaskListForProjection(List *taskList, List *projectedTargetEntries);
|
static void WrapTaskListForProjection(List *taskList, List *projectedTargetEntries);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,13 @@ static HTAB * ExecuteMergeSourcePlanIntoColocatedIntermediateResults(Oid targetR
|
||||||
sourceTargetList,
|
sourceTargetList,
|
||||||
PlannedStmt *
|
PlannedStmt *
|
||||||
sourcePlan,
|
sourcePlan,
|
||||||
EState *executorState,
|
EState *executorState
|
||||||
|
,
|
||||||
char *
|
char *
|
||||||
intermediateResultIdPrefix,
|
intermediateResultIdPrefix,
|
||||||
int
|
int
|
||||||
partitionColumnIndex);
|
partitionColumnIndex)
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -180,9 +180,10 @@ static bool FollowExtAndInternalDependencies(ObjectAddressCollector *collector,
|
||||||
DependencyDefinition *definition);
|
DependencyDefinition *definition);
|
||||||
static void ApplyAddToDependencyList(ObjectAddressCollector *collector,
|
static void ApplyAddToDependencyList(ObjectAddressCollector *collector,
|
||||||
DependencyDefinition *definition);
|
DependencyDefinition *definition);
|
||||||
static void ApplyAddCitusDependedObjectsToDependencyList(
|
static void ApplyAddCitusDependedObjectsToDependencyList(ObjectAddressCollector *collector
|
||||||
ObjectAddressCollector *collector,
|
,
|
||||||
DependencyDefinition *definition);
|
DependencyDefinition *definition)
|
||||||
|
;
|
||||||
static List * GetViewRuleReferenceDependencyList(Oid relationId);
|
static List * GetViewRuleReferenceDependencyList(Oid relationId);
|
||||||
static List * ExpandCitusSupportedTypes(ObjectAddressCollector *collector,
|
static List * ExpandCitusSupportedTypes(ObjectAddressCollector *collector,
|
||||||
ObjectAddress target);
|
ObjectAddress target);
|
||||||
|
|
|
||||||
|
|
@ -338,8 +338,8 @@ ShouldMarkRelationDistributed(Oid relationId)
|
||||||
bool ownedByExtension = IsTableOwnedByExtension(relationId);
|
bool ownedByExtension = IsTableOwnedByExtension(relationId);
|
||||||
bool alreadyDistributed = IsObjectDistributed(relationAddress);
|
bool alreadyDistributed = IsObjectDistributed(relationAddress);
|
||||||
bool hasUnsupportedDependency =
|
bool hasUnsupportedDependency =
|
||||||
DeferErrorIfAnyObjectHasUnsupportedDependency(list_make1(relationAddress)) !=
|
DeferErrorIfAnyObjectHasUnsupportedDependency(list_make1(relationAddress)) != NULL
|
||||||
NULL;
|
;
|
||||||
bool hasCircularDependency =
|
bool hasCircularDependency =
|
||||||
DeferErrorIfCircularDependencyExists(relationAddress) != NULL;
|
DeferErrorIfCircularDependencyExists(relationAddress) != NULL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -812,7 +812,6 @@ GenerateSizeQueryOnMultiplePlacements(List *shardIntervalList,
|
||||||
{
|
{
|
||||||
partitionedShardNames = lappend(partitionedShardNames, quotedShardName);
|
partitionedShardNames = lappend(partitionedShardNames, quotedShardName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for non-partitioned tables, we will use Postgres' size functions */
|
/* for non-partitioned tables, we will use Postgres' size functions */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -823,7 +822,8 @@ GenerateSizeQueryOnMultiplePlacements(List *shardIntervalList,
|
||||||
/* SELECT SUM(worker_partitioned_...) FROM VALUES (...) */
|
/* SELECT SUM(worker_partitioned_...) FROM VALUES (...) */
|
||||||
char *subqueryForPartitionedShards =
|
char *subqueryForPartitionedShards =
|
||||||
GenerateSizeQueryForRelationNameList(partitionedShardNames,
|
GenerateSizeQueryForRelationNameList(partitionedShardNames,
|
||||||
GetWorkerPartitionedSizeUDFNameBySizeQueryType(
|
GetWorkerPartitionedSizeUDFNameBySizeQueryType
|
||||||
|
(
|
||||||
sizeQueryType));
|
sizeQueryType));
|
||||||
|
|
||||||
/* SELECT SUM(pg_..._size) FROM VALUES (...) */
|
/* SELECT SUM(pg_..._size) FROM VALUES (...) */
|
||||||
|
|
@ -4267,7 +4267,8 @@ CancelTasksForJob(int64 jobid)
|
||||||
|
|
||||||
const bool indexOK = true;
|
const bool indexOK = true;
|
||||||
SysScanDesc scanDescriptor = systable_beginscan(pgDistBackgroundTasks,
|
SysScanDesc scanDescriptor = systable_beginscan(pgDistBackgroundTasks,
|
||||||
DistBackgroundTaskJobIdTaskIdIndexId(),
|
DistBackgroundTaskJobIdTaskIdIndexId()
|
||||||
|
,
|
||||||
indexOK, NULL,
|
indexOK, NULL,
|
||||||
lengthof(scanKey), scanKey);
|
lengthof(scanKey), scanKey);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,8 @@ static List * DropTaskList(Oid relationId, char *schemaName, char *relationName,
|
||||||
List *deletableShardIntervalList);
|
List *deletableShardIntervalList);
|
||||||
static void ExecuteDropShardPlacementCommandRemotely(ShardPlacement *shardPlacement,
|
static void ExecuteDropShardPlacementCommandRemotely(ShardPlacement *shardPlacement,
|
||||||
const char *shardRelationName,
|
const char *shardRelationName,
|
||||||
const char *dropShardPlacementCommand);
|
const char *dropShardPlacementCommand
|
||||||
|
);
|
||||||
static char * CreateDropShardPlacementCommand(const char *schemaName,
|
static char * CreateDropShardPlacementCommand(const char *schemaName,
|
||||||
const char *shardRelationName,
|
const char *shardRelationName,
|
||||||
char storageType);
|
char storageType);
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ static void GatherIndexAndConstraintDefinitionListExcludingReplicaIdentity(Form_
|
||||||
indexForm,
|
indexForm,
|
||||||
List **
|
List **
|
||||||
indexDDLEventList,
|
indexDDLEventList,
|
||||||
int indexFlags);
|
int indexFlags)
|
||||||
|
;
|
||||||
static Datum WorkerNodeGetDatum(WorkerNode *workerNode, TupleDesc tupleDescriptor);
|
static Datum WorkerNodeGetDatum(WorkerNode *workerNode, TupleDesc tupleDescriptor);
|
||||||
|
|
||||||
static char * CitusCreateAlterColumnarTableSet(char *qualifiedRelationName,
|
static char * CitusCreateAlterColumnarTableSet(char *qualifiedRelationName,
|
||||||
|
|
|
||||||
|
|
@ -939,8 +939,8 @@ TryDropDatabaseOutsideTransaction(char *databaseName, char *nodeName, int nodePo
|
||||||
* because we don't want to open a transaction block on remote nodes as DROP
|
* because we don't want to open a transaction block on remote nodes as DROP
|
||||||
* DATABASE commands cannot be run inside a transaction block.
|
* DATABASE commands cannot be run inside a transaction block.
|
||||||
*/
|
*/
|
||||||
if (ExecuteOptionalRemoteCommand(connection, commandString, NULL) !=
|
if (ExecuteOptionalRemoteCommand(connection, commandString, NULL) != RESPONSE_OKAY
|
||||||
RESPONSE_OKAY)
|
)
|
||||||
{
|
{
|
||||||
executeCommand = false;
|
executeCommand = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -131,14 +131,16 @@ static void UpdateDistributionColumnsForShardGroup(List *colocatedShardList,
|
||||||
uint32 colocationId);
|
uint32 colocationId);
|
||||||
static void InsertSplitChildrenShardMetadata(List *shardGroupSplitIntervalListList,
|
static void InsertSplitChildrenShardMetadata(List *shardGroupSplitIntervalListList,
|
||||||
List *workersForPlacementList);
|
List *workersForPlacementList);
|
||||||
static void CreatePartitioningHierarchyForBlockingSplit(
|
static void CreatePartitioningHierarchyForBlockingSplit(List *
|
||||||
List *shardGroupSplitIntervalListList,
|
shardGroupSplitIntervalListList,
|
||||||
List *workersForPlacementList);
|
List *workersForPlacementList);
|
||||||
static void CreateForeignKeyConstraints(List *shardGroupSplitIntervalListList,
|
static void CreateForeignKeyConstraints(List *shardGroupSplitIntervalListList,
|
||||||
List *workersForPlacementList);
|
List *workersForPlacementList);
|
||||||
static Task * CreateTaskForDDLCommandList(List *ddlCommandList, WorkerNode *workerNode);
|
static Task * CreateTaskForDDLCommandList(List *ddlCommandList, WorkerNode *workerNode);
|
||||||
static StringInfo CreateSplitShardReplicationSetupUDF(
|
static StringInfo CreateSplitShardReplicationSetupUDF(List *
|
||||||
List *sourceColocatedShardIntervalList, List *shardGroupSplitIntervalListList,
|
sourceColocatedShardIntervalList,
|
||||||
|
List *
|
||||||
|
shardGroupSplitIntervalListList,
|
||||||
List *destinationWorkerNodesList,
|
List *destinationWorkerNodesList,
|
||||||
DistributionColumnMap *
|
DistributionColumnMap *
|
||||||
distributionColumnOverrides);
|
distributionColumnOverrides);
|
||||||
|
|
@ -883,7 +885,8 @@ DoSplitCopy(WorkerNode *sourceShardNode, List *sourceColocatedShardIntervalList,
|
||||||
|
|
||||||
ExecuteTaskListOutsideTransaction(ROW_MODIFY_NONE, splitCopyTaskList,
|
ExecuteTaskListOutsideTransaction(ROW_MODIFY_NONE, splitCopyTaskList,
|
||||||
MaxAdaptiveExecutorPoolSize,
|
MaxAdaptiveExecutorPoolSize,
|
||||||
NULL /* jobIdList (ignored by API implementation) */);
|
NULL /* jobIdList (ignored by API implementation) */
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1881,7 +1884,8 @@ ExecuteSplitShardReplicationSetupUDF(WorkerNode *sourceWorkerNode,
|
||||||
ereport(ERROR, (errcode(ERRCODE_CONNECTION_FAILURE),
|
ereport(ERROR, (errcode(ERRCODE_CONNECTION_FAILURE),
|
||||||
errmsg(
|
errmsg(
|
||||||
"Failed to run worker_split_shard_replication_setup UDF. It should successfully execute "
|
"Failed to run worker_split_shard_replication_setup UDF. It should successfully execute "
|
||||||
" for splitting a shard in a non-blocking way. Please retry.")));
|
" for splitting a shard in a non-blocking way. Please retry.")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get replication slot information */
|
/* Get replication slot information */
|
||||||
|
|
|
||||||
|
|
@ -471,8 +471,8 @@ WriteLocalTuple(TupleTableSlot *slot, ShardCopyDestReceiver *copyDest)
|
||||||
SetLocalExecutionStatus(LOCAL_EXECUTION_REQUIRED);
|
SetLocalExecutionStatus(LOCAL_EXECUTION_REQUIRED);
|
||||||
|
|
||||||
bool isBinaryCopy = localCopyOutState->binary;
|
bool isBinaryCopy = localCopyOutState->binary;
|
||||||
bool shouldAddBinaryHeaders = (isBinaryCopy && localCopyOutState->fe_msgbuf->len ==
|
bool shouldAddBinaryHeaders = (isBinaryCopy && localCopyOutState->fe_msgbuf->len == 0)
|
||||||
0);
|
;
|
||||||
if (shouldAddBinaryHeaders)
|
if (shouldAddBinaryHeaders)
|
||||||
{
|
{
|
||||||
AppendCopyBinaryHeaders(localCopyOutState);
|
AppendCopyBinaryHeaders(localCopyOutState);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,8 @@ worker_split_copy(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
|
ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
|
||||||
errmsg(
|
errmsg(
|
||||||
"pg_catalog.split_copy_info array cannot contain null values")));
|
"pg_catalog.split_copy_info array cannot contain null values")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
const int slice_ndim = 0;
|
const int slice_ndim = 0;
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ int PlannerLevel = 0;
|
||||||
|
|
||||||
static bool ListContainsDistributedTableRTE(List *rangeTableList,
|
static bool ListContainsDistributedTableRTE(List *rangeTableList,
|
||||||
bool *maybeHasForeignDistributedTable);
|
bool *maybeHasForeignDistributedTable);
|
||||||
static PlannedStmt * CreateDistributedPlannedStmt(
|
static PlannedStmt * CreateDistributedPlannedStmt(DistributedPlanningContext *planContext)
|
||||||
DistributedPlanningContext *planContext);
|
;
|
||||||
static PlannedStmt * InlineCtesAndCreateDistributedPlannedStmt(uint64 planId,
|
static PlannedStmt * InlineCtesAndCreateDistributedPlannedStmt(uint64 planId,
|
||||||
DistributedPlanningContext
|
DistributedPlanningContext
|
||||||
*planContext);
|
*planContext);
|
||||||
|
|
@ -125,14 +125,14 @@ static void AdjustReadIntermediateResultsCostInternal(RelOptInfo *relOptInfo,
|
||||||
Const *resultFormatConst);
|
Const *resultFormatConst);
|
||||||
static List * OuterPlanParamsList(PlannerInfo *root);
|
static List * OuterPlanParamsList(PlannerInfo *root);
|
||||||
static List * CopyPlanParamList(List *originalPlanParamList);
|
static List * CopyPlanParamList(List *originalPlanParamList);
|
||||||
static void CreateAndPushPlannerRestrictionContext(
|
static void CreateAndPushPlannerRestrictionContext(DistributedPlanningContext *planContext
|
||||||
DistributedPlanningContext *planContext,
|
,
|
||||||
FastPathRestrictionContext *
|
FastPathRestrictionContext *
|
||||||
fastPathContext);
|
fastPathContext);
|
||||||
static PlannerRestrictionContext * CurrentPlannerRestrictionContext(void);
|
static PlannerRestrictionContext * CurrentPlannerRestrictionContext(void);
|
||||||
static void PopPlannerRestrictionContext(void);
|
static void PopPlannerRestrictionContext(void);
|
||||||
static void ResetPlannerRestrictionContext(
|
static void ResetPlannerRestrictionContext(PlannerRestrictionContext *
|
||||||
PlannerRestrictionContext *plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
static PlannedStmt * PlanFastPathDistributedStmt(DistributedPlanningContext *planContext);
|
static PlannedStmt * PlanFastPathDistributedStmt(DistributedPlanningContext *planContext);
|
||||||
static PlannedStmt * PlanDistributedStmt(DistributedPlanningContext *planContext,
|
static PlannedStmt * PlanDistributedStmt(DistributedPlanningContext *planContext,
|
||||||
int rteIdCounter);
|
int rteIdCounter);
|
||||||
|
|
|
||||||
|
|
@ -831,7 +831,8 @@ IsShardKeyValueAllowed(Const *shardKey, uint32 colocationId)
|
||||||
ereport(DEBUG4, errmsg("Comparing saved:%s with Shard key: %s colocationid:%d:%d",
|
ereport(DEBUG4, errmsg("Comparing saved:%s with Shard key: %s colocationid:%d:%d",
|
||||||
pretty_format_node_dump(
|
pretty_format_node_dump(
|
||||||
nodeToString(
|
nodeToString(
|
||||||
AllowedDistributionColumnValue.distributionColumnValue)),
|
AllowedDistributionColumnValue.distributionColumnValue)
|
||||||
|
),
|
||||||
pretty_format_node_dump(nodeToString(shardKey)),
|
pretty_format_node_dump(nodeToString(shardKey)),
|
||||||
AllowedDistributionColumnValue.colocationId, colocationId));
|
AllowedDistributionColumnValue.colocationId, colocationId));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ static bool InsertSelectHasRouterSelect(Query *originalQuery,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
static Task * RouterModifyTaskForShardInterval(Query *originalQuery,
|
static Task * RouterModifyTaskForShardInterval(Query *originalQuery,
|
||||||
CitusTableCacheEntry *targetTableCacheEntry,
|
CitusTableCacheEntry *targetTableCacheEntry
|
||||||
|
,
|
||||||
ShardInterval *shardInterval,
|
ShardInterval *shardInterval,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext,
|
plannerRestrictionContext,
|
||||||
|
|
@ -1155,7 +1156,8 @@ ReorderInsertSelectTargetLists(Query *originalQuery, RangeTblEntry *insertRte,
|
||||||
TargetEntry *newInsertTargetEntry = makeTargetEntry((Expr *) newInsertVar,
|
TargetEntry *newInsertTargetEntry = makeTargetEntry((Expr *) newInsertVar,
|
||||||
originalAttrNo,
|
originalAttrNo,
|
||||||
oldInsertTargetEntry->resname,
|
oldInsertTargetEntry->resname,
|
||||||
oldInsertTargetEntry->resjunk);
|
oldInsertTargetEntry->resjunk)
|
||||||
|
;
|
||||||
|
|
||||||
newInsertTargetlist = lappend(newInsertTargetlist, newInsertTargetEntry);
|
newInsertTargetlist = lappend(newInsertTargetlist, newInsertTargetEntry);
|
||||||
resno++;
|
resno++;
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,8 @@ static DeferredErrorMessage * MergeQualAndTargetListFunctionsSupported(Oid
|
||||||
Query *query,
|
Query *query,
|
||||||
Node *quals,
|
Node *quals,
|
||||||
List *targetList,
|
List *targetList,
|
||||||
CmdType commandType);
|
CmdType commandType
|
||||||
|
);
|
||||||
|
|
||||||
static DistributedPlan * CreateRouterMergePlan(Oid targetRelationId, Query *originalQuery,
|
static DistributedPlan * CreateRouterMergePlan(Oid targetRelationId, Query *originalQuery,
|
||||||
Query *query,
|
Query *query,
|
||||||
|
|
@ -574,8 +575,8 @@ IsDistributionColumnInMergeSource(Expr *columnExpression, Query *query, bool
|
||||||
Var *distributionColumn = DistPartitionKey(relationId);
|
Var *distributionColumn = DistPartitionKey(relationId);
|
||||||
|
|
||||||
/* not all distributed tables have partition column */
|
/* not all distributed tables have partition column */
|
||||||
if (distributionColumn != NULL && column->varattno ==
|
if (distributionColumn != NULL && column->varattno == distributionColumn->varattno
|
||||||
distributionColumn->varattno)
|
)
|
||||||
{
|
{
|
||||||
isDistributionColumn = true;
|
isDistributionColumn = true;
|
||||||
}
|
}
|
||||||
|
|
@ -1046,7 +1047,8 @@ DeferErrorIfTargetHasFalseClause(Oid targetRelationId,
|
||||||
{
|
{
|
||||||
ListCell *restrictionCell = NULL;
|
ListCell *restrictionCell = NULL;
|
||||||
foreach(restrictionCell,
|
foreach(restrictionCell,
|
||||||
plannerRestrictionContext->relationRestrictionContext->relationRestrictionList)
|
plannerRestrictionContext->relationRestrictionContext->relationRestrictionList
|
||||||
|
)
|
||||||
{
|
{
|
||||||
RelationRestriction *relationRestriction =
|
RelationRestriction *relationRestriction =
|
||||||
(RelationRestriction *) lfirst(restrictionCell);
|
(RelationRestriction *) lfirst(restrictionCell);
|
||||||
|
|
@ -1078,7 +1080,8 @@ DeferErrorIfTargetHasFalseClause(Oid targetRelationId,
|
||||||
*/
|
*/
|
||||||
static DeferredErrorMessage *
|
static DeferredErrorMessage *
|
||||||
DeferErrorIfRoutableMergeNotSupported(Query *query, List *rangeTableList,
|
DeferErrorIfRoutableMergeNotSupported(Query *query, List *rangeTableList,
|
||||||
PlannerRestrictionContext *plannerRestrictionContext,
|
PlannerRestrictionContext *plannerRestrictionContext
|
||||||
|
,
|
||||||
Oid targetRelationId)
|
Oid targetRelationId)
|
||||||
{
|
{
|
||||||
List *distTablesList = NIL;
|
List *distTablesList = NIL;
|
||||||
|
|
@ -1116,7 +1119,8 @@ DeferErrorIfRoutableMergeNotSupported(Query *query, List *rangeTableList,
|
||||||
if (list_length(distTablesList) > 0 && list_length(localTablesList) > 0)
|
if (list_length(distTablesList) > 0 && list_length(localTablesList) > 0)
|
||||||
{
|
{
|
||||||
ereport(DEBUG1, (errmsg(
|
ereport(DEBUG1, (errmsg(
|
||||||
"A mix of distributed and local table, try repartitioning")));
|
"A mix of distributed and local table, try repartitioning")))
|
||||||
|
;
|
||||||
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
|
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
|
||||||
"A mix of distributed and citus-local table, "
|
"A mix of distributed and citus-local table, "
|
||||||
"routable query is not possible", NULL, NULL);
|
"routable query is not possible", NULL, NULL);
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,8 @@ static void AppendTargetEntryToGroupClause(TargetEntry *targetEntry,
|
||||||
static bool WorkerAggregateWalker(Node *node,
|
static bool WorkerAggregateWalker(Node *node,
|
||||||
WorkerAggregateWalkerContext *walkerContext);
|
WorkerAggregateWalkerContext *walkerContext);
|
||||||
static List * WorkerAggregateExpressionList(Aggref *originalAggregate,
|
static List * WorkerAggregateExpressionList(Aggref *originalAggregate,
|
||||||
WorkerAggregateWalkerContext *walkerContextry);
|
WorkerAggregateWalkerContext *walkerContextry)
|
||||||
|
;
|
||||||
static AggregateType GetAggregateType(Aggref *aggregatExpression);
|
static AggregateType GetAggregateType(Aggref *aggregatExpression);
|
||||||
static Oid AggregateArgumentType(Aggref *aggregate);
|
static Oid AggregateArgumentType(Aggref *aggregate);
|
||||||
static Expr * FirstAggregateArgument(Aggref *aggregate);
|
static Expr * FirstAggregateArgument(Aggref *aggregate);
|
||||||
|
|
@ -293,16 +294,17 @@ static Const * MakeIntegerConst(int32 integerValue);
|
||||||
/* Local functions forward declarations for aggregate expression checks */
|
/* Local functions forward declarations for aggregate expression checks */
|
||||||
static bool HasNonDistributableAggregates(MultiNode *logicalPlanNode);
|
static bool HasNonDistributableAggregates(MultiNode *logicalPlanNode);
|
||||||
static bool CanPushDownExpression(Node *expression,
|
static bool CanPushDownExpression(Node *expression,
|
||||||
const ExtendedOpNodeProperties *extendedOpNodeProperties);
|
const ExtendedOpNodeProperties *extendedOpNodeProperties
|
||||||
static DeferredErrorMessage * DeferErrorIfHasNonDistributableAggregates(
|
);
|
||||||
MultiNode *logicalPlanNode);
|
static DeferredErrorMessage * DeferErrorIfHasNonDistributableAggregates(MultiNode *
|
||||||
static DeferredErrorMessage * DeferErrorIfUnsupportedArrayAggregate(
|
logicalPlanNode);
|
||||||
Aggref *arrayAggregateExpression);
|
static DeferredErrorMessage * DeferErrorIfUnsupportedArrayAggregate(Aggref *
|
||||||
|
arrayAggregateExpression);
|
||||||
static DeferredErrorMessage * DeferErrorIfUnsupportedJsonAggregate(AggregateType type,
|
static DeferredErrorMessage * DeferErrorIfUnsupportedJsonAggregate(AggregateType type,
|
||||||
Aggref *
|
Aggref *
|
||||||
aggregateExpression);
|
aggregateExpression);
|
||||||
static DeferredErrorMessage * DeferErrorIfUnsupportedAggregateDistinct(
|
static DeferredErrorMessage * DeferErrorIfUnsupportedAggregateDistinct(Aggref *
|
||||||
Aggref *aggregateExpression,
|
aggregateExpression,
|
||||||
MultiNode *
|
MultiNode *
|
||||||
logicalPlanNode);
|
logicalPlanNode);
|
||||||
static Var * AggregateDistinctColumn(Aggref *aggregateExpression);
|
static Var * AggregateDistinctColumn(Aggref *aggregateExpression);
|
||||||
|
|
@ -322,8 +324,8 @@ static bool HasOrderByAggregate(List *sortClauseList, List *targetList);
|
||||||
static bool HasOrderByNonCommutativeAggregate(List *sortClauseList, List *targetList);
|
static bool HasOrderByNonCommutativeAggregate(List *sortClauseList, List *targetList);
|
||||||
static bool HasOrderByComplexExpression(List *sortClauseList, List *targetList);
|
static bool HasOrderByComplexExpression(List *sortClauseList, List *targetList);
|
||||||
static bool HasOrderByHllType(List *sortClauseList, List *targetList);
|
static bool HasOrderByHllType(List *sortClauseList, List *targetList);
|
||||||
static bool ShouldProcessDistinctOrderAndLimitForWorker(
|
static bool ShouldProcessDistinctOrderAndLimitForWorker(ExtendedOpNodeProperties *
|
||||||
ExtendedOpNodeProperties *extendedOpNodeProperties,
|
extendedOpNodeProperties,
|
||||||
bool pushingDownOriginalGrouping,
|
bool pushingDownOriginalGrouping,
|
||||||
Node *havingQual);
|
Node *havingQual);
|
||||||
static bool IsIndexInRange(const List *list, int index);
|
static bool IsIndexInRange(const List *list, int index);
|
||||||
|
|
@ -5061,8 +5063,8 @@ HasOrderByHllType(List *sortClauseList, List *targetList)
|
||||||
* neither should ProcessLimitOrderByForWorkerQuery.
|
* neither should ProcessLimitOrderByForWorkerQuery.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
ShouldProcessDistinctOrderAndLimitForWorker(
|
ShouldProcessDistinctOrderAndLimitForWorker(ExtendedOpNodeProperties *
|
||||||
ExtendedOpNodeProperties *extendedOpNodeProperties,
|
extendedOpNodeProperties,
|
||||||
bool pushingDownOriginalGrouping,
|
bool pushingDownOriginalGrouping,
|
||||||
Node *havingQual)
|
Node *havingQual)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,8 @@ static String * MakeDummyColumnString(int dummyColumnId);
|
||||||
static List * BuildRoutesForInsert(Query *query, DeferredErrorMessage **planningError);
|
static List * BuildRoutesForInsert(Query *query, DeferredErrorMessage **planningError);
|
||||||
static List * GroupInsertValuesByShardId(List *insertValuesList);
|
static List * GroupInsertValuesByShardId(List *insertValuesList);
|
||||||
static List * ExtractInsertValuesList(Query *query, Var *partitionColumn);
|
static List * ExtractInsertValuesList(Query *query, Var *partitionColumn);
|
||||||
static DeferredErrorMessage * DeferErrorIfUnsupportedRouterPlannableSelectQuery(
|
static DeferredErrorMessage * DeferErrorIfUnsupportedRouterPlannableSelectQuery(Query *
|
||||||
Query *query);
|
query);
|
||||||
static DeferredErrorMessage * ErrorIfQueryHasUnroutableModifyingCTE(Query *queryTree);
|
static DeferredErrorMessage * ErrorIfQueryHasUnroutableModifyingCTE(Query *queryTree);
|
||||||
static DeferredErrorMessage * ErrorIfQueryHasCTEWithSearchClause(Query *queryTree);
|
static DeferredErrorMessage * ErrorIfQueryHasCTEWithSearchClause(Query *queryTree);
|
||||||
static bool ContainsSearchClauseWalker(Node *node, void *context);
|
static bool ContainsSearchClauseWalker(Node *node, void *context);
|
||||||
|
|
@ -855,7 +855,8 @@ DeferErrorIfUnsupportedLocalTableJoin(List *rangeTableList)
|
||||||
"Modifying local tables with remote local tables is "
|
"Modifying local tables with remote local tables is "
|
||||||
"not supported.",
|
"not supported.",
|
||||||
NULL,
|
NULL,
|
||||||
"Consider wrapping remote local table to a CTE, or subquery");
|
"Consider wrapping remote local table to a CTE, or subquery")
|
||||||
|
;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -3152,7 +3153,8 @@ TargetShardIntervalForFastPathQuery(Query *query, bool *isMultiShardQuery,
|
||||||
if (cachedShardInterval == NULL)
|
if (cachedShardInterval == NULL)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"could not find shardinterval to which to send the query")));
|
"could not find shardinterval to which to send the query")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputPartitionValueConst != NULL)
|
if (outputPartitionValueConst != NULL)
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,12 @@ static AttrNumber FindResnoForVarInTargetList(List *targetList, int varno, int v
|
||||||
static bool RelationInfoContainsOnlyRecurringTuples(PlannerInfo *plannerInfo,
|
static bool RelationInfoContainsOnlyRecurringTuples(PlannerInfo *plannerInfo,
|
||||||
Relids relids);
|
Relids relids);
|
||||||
static char * RecurringTypeDescription(RecurringTuplesType recurType);
|
static char * RecurringTypeDescription(RecurringTuplesType recurType);
|
||||||
static DeferredErrorMessage * DeferredErrorIfUnsupportedLateralSubquery(
|
static DeferredErrorMessage * DeferredErrorIfUnsupportedLateralSubquery(PlannerInfo *
|
||||||
PlannerInfo *plannerInfo, Relids recurringRelIds, Relids nonRecurringRelIds);
|
plannerInfo,
|
||||||
|
Relids
|
||||||
|
recurringRelIds,
|
||||||
|
Relids
|
||||||
|
nonRecurringRelIds);
|
||||||
static bool ContainsLateralSubquery(PlannerInfo *plannerInfo);
|
static bool ContainsLateralSubquery(PlannerInfo *plannerInfo);
|
||||||
static Var * PartitionColumnForPushedDownSubquery(Query *query);
|
static Var * PartitionColumnForPushedDownSubquery(Query *query);
|
||||||
static bool ContainsReferencesToRelids(Query *query, Relids relids, int *foundRelid);
|
static bool ContainsReferencesToRelids(Query *query, Relids relids, int *foundRelid);
|
||||||
|
|
@ -790,8 +794,8 @@ FromClauseRecurringTupleType(Query *queryTree)
|
||||||
* such queries have lateral subqueries.
|
* such queries have lateral subqueries.
|
||||||
*/
|
*/
|
||||||
static DeferredErrorMessage *
|
static DeferredErrorMessage *
|
||||||
DeferredErrorIfUnsupportedRecurringTuplesJoin(
|
DeferredErrorIfUnsupportedRecurringTuplesJoin(PlannerRestrictionContext *
|
||||||
PlannerRestrictionContext *plannerRestrictionContext,
|
plannerRestrictionContext,
|
||||||
bool plannerPhase)
|
bool plannerPhase)
|
||||||
{
|
{
|
||||||
List *joinRestrictionList =
|
List *joinRestrictionList =
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,8 @@ static void RecursivelyPlanNonColocatedSubqueriesInWhere(Query *query,
|
||||||
RecursivePlanningContext *
|
RecursivePlanningContext *
|
||||||
recursivePlanningContext);
|
recursivePlanningContext);
|
||||||
static bool RecursivelyPlanRecurringTupleOuterJoinWalker(Node *node, Query *query,
|
static bool RecursivelyPlanRecurringTupleOuterJoinWalker(Node *node, Query *query,
|
||||||
RecursivePlanningContext *context,
|
RecursivePlanningContext *context
|
||||||
|
,
|
||||||
bool chainedJoin);
|
bool chainedJoin);
|
||||||
static void RecursivelyPlanDistributedJoinNode(Node *node, Query *query,
|
static void RecursivelyPlanDistributedJoinNode(Node *node, Query *query,
|
||||||
RecursivePlanningContext *context);
|
RecursivePlanningContext *context);
|
||||||
|
|
@ -207,8 +208,8 @@ static bool CanPushdownRecurringOuterJoinOnOuterRTE(RangeTblEntry *rte);
|
||||||
static bool CanPushdownRecurringOuterJoinOnInnerVar(Var *innervar, RangeTblEntry *rte);
|
static bool CanPushdownRecurringOuterJoinOnInnerVar(Var *innervar, RangeTblEntry *rte);
|
||||||
static bool CanPushdownRecurringOuterJoin(JoinExpr *joinExpr, Query *query);
|
static bool CanPushdownRecurringOuterJoin(JoinExpr *joinExpr, Query *query);
|
||||||
#if PG_VERSION_NUM < PG_VERSION_17
|
#if PG_VERSION_NUM < PG_VERSION_17
|
||||||
static bool hasPseudoconstantQuals(
|
static bool hasPseudoconstantQuals(RelationRestrictionContext *relationRestrictionContext)
|
||||||
RelationRestrictionContext *relationRestrictionContext);
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -2780,8 +2781,8 @@ CanPushdownRecurringOuterJoinOnInnerVar(Var *innerVar, RangeTblEntry *rte)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the inner variable is part of the distribution column */
|
/* Check if the inner variable is part of the distribution column */
|
||||||
if (cacheEntry->partitionColumn && innerVar->varattno ==
|
if (cacheEntry->partitionColumn && innerVar->varattno == cacheEntry->partitionColumn->
|
||||||
cacheEntry->partitionColumn->varattno)
|
varattno)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -2922,7 +2923,8 @@ CanPushdownRecurringOuterJoinExtended(JoinExpr *joinExpr, Query *query,
|
||||||
joinExpr->larg, query->rtable))
|
joinExpr->larg, query->rtable))
|
||||||
{
|
{
|
||||||
ereport(DEBUG5, (errmsg(
|
ereport(DEBUG5, (errmsg(
|
||||||
"Lateral join is not supported for pushdown in this path.")));
|
"Lateral join is not supported for pushdown in this path.")))
|
||||||
|
;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,8 +156,9 @@ static bool AllDistributedRelationsInRestrictionContextColocated(
|
||||||
restrictionContext);
|
restrictionContext);
|
||||||
static bool IsNotSafeRestrictionToRecursivelyPlan(Node *node);
|
static bool IsNotSafeRestrictionToRecursivelyPlan(Node *node);
|
||||||
static bool HasPlaceHolderVar(Node *node);
|
static bool HasPlaceHolderVar(Node *node);
|
||||||
static JoinRestrictionContext * FilterJoinRestrictionContext(
|
static JoinRestrictionContext * FilterJoinRestrictionContext(JoinRestrictionContext *
|
||||||
JoinRestrictionContext *joinRestrictionContext, Relids
|
joinRestrictionContext,
|
||||||
|
Relids
|
||||||
queryRteIdentities);
|
queryRteIdentities);
|
||||||
static bool RangeTableArrayContainsAnyRTEIdentities(RangeTblEntry **rangeTableEntries, int
|
static bool RangeTableArrayContainsAnyRTEIdentities(RangeTblEntry **rangeTableEntries, int
|
||||||
rangeTableArrayLength, Relids
|
rangeTableArrayLength, Relids
|
||||||
|
|
@ -614,7 +615,8 @@ RestrictionEquivalenceForPartitionKeys(PlannerRestrictionContext *restrictionCon
|
||||||
List *attributeEquivalenceList = GenerateAllAttributeEquivalences(restrictionContext);
|
List *attributeEquivalenceList = GenerateAllAttributeEquivalences(restrictionContext);
|
||||||
|
|
||||||
return RestrictionEquivalenceForPartitionKeysViaEquivalences(restrictionContext,
|
return RestrictionEquivalenceForPartitionKeysViaEquivalences(restrictionContext,
|
||||||
attributeEquivalenceList);
|
attributeEquivalenceList)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1160,8 +1162,8 @@ GenerateCommonEquivalence(List *attributeEquivalenceList,
|
||||||
* with a single AttributeEquivalenceClassMember.
|
* with a single AttributeEquivalenceClassMember.
|
||||||
*/
|
*/
|
||||||
static AttributeEquivalenceClass *
|
static AttributeEquivalenceClass *
|
||||||
GenerateEquivalenceClassForRelationRestriction(
|
GenerateEquivalenceClassForRelationRestriction(RelationRestrictionContext *
|
||||||
RelationRestrictionContext *relationRestrictionContext)
|
relationRestrictionContext)
|
||||||
{
|
{
|
||||||
ListCell *relationRestrictionCell = NULL;
|
ListCell *relationRestrictionCell = NULL;
|
||||||
AttributeEquivalenceClassMember *eqMember = NULL;
|
AttributeEquivalenceClassMember *eqMember = NULL;
|
||||||
|
|
@ -2071,8 +2073,8 @@ FindQueryContainingRTEIdentityInternal(Node *node,
|
||||||
* distributed relations in the given relation restrictions list are co-located.
|
* distributed relations in the given relation restrictions list are co-located.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
AllDistributedRelationsInRestrictionContextColocated(
|
AllDistributedRelationsInRestrictionContextColocated(RelationRestrictionContext *
|
||||||
RelationRestrictionContext *restrictionContext)
|
restrictionContext)
|
||||||
{
|
{
|
||||||
RelationRestriction *relationRestriction = NULL;
|
RelationRestriction *relationRestriction = NULL;
|
||||||
List *relationIdList = NIL;
|
List *relationIdList = NIL;
|
||||||
|
|
|
||||||
|
|
@ -1215,9 +1215,11 @@ AddPartitionKeyRestrictionToInstance(ClauseWalkerContext *context, OpExpr *opCla
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
Assert(false);
|
Assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prune->hasValidConstraint = true;
|
prune->hasValidConstraint = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,8 @@ static void ExecuteRemainingPostLoadTableCommands(List *logicalRepTargetList);
|
||||||
static char * escape_param_str(const char *str);
|
static char * escape_param_str(const char *str);
|
||||||
static XLogRecPtr GetRemoteLSN(MultiConnection *connection, char *command);
|
static XLogRecPtr GetRemoteLSN(MultiConnection *connection, char *command);
|
||||||
static void WaitForMiliseconds(long timeout);
|
static void WaitForMiliseconds(long timeout);
|
||||||
static XLogRecPtr GetSubscriptionPosition(
|
static XLogRecPtr GetSubscriptionPosition(GroupedLogicalRepTargets *
|
||||||
GroupedLogicalRepTargets *groupedLogicalRepTargets);
|
groupedLogicalRepTargets);
|
||||||
|
|
||||||
static HTAB * CreateShardMovePublicationInfoHash(WorkerNode *targetNode,
|
static HTAB * CreateShardMovePublicationInfoHash(WorkerNode *targetNode,
|
||||||
List *shardIntervals);
|
List *shardIntervals);
|
||||||
|
|
|
||||||
|
|
@ -210,10 +210,12 @@ shard_split_change_cb(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
|
||||||
|
|
||||||
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ereport(ERROR, errmsg(
|
ereport(ERROR, errmsg(
|
||||||
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
||||||
change->action));
|
change->action));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
switch (change->action)
|
switch (change->action)
|
||||||
{
|
{
|
||||||
|
|
@ -245,10 +247,12 @@ shard_split_change_cb(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
|
||||||
|
|
||||||
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ereport(ERROR, errmsg(
|
ereport(ERROR, errmsg(
|
||||||
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
||||||
change->action));
|
change->action));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Current replication slot is not responsible for handling the change */
|
/* Current replication slot is not responsible for handling the change */
|
||||||
|
|
@ -318,10 +322,12 @@ shard_split_change_cb(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
|
||||||
|
|
||||||
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ereport(ERROR, errmsg(
|
ereport(ERROR, errmsg(
|
||||||
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
||||||
change->action));
|
change->action));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
switch (change->action)
|
switch (change->action)
|
||||||
{
|
{
|
||||||
|
|
@ -373,10 +379,12 @@ shard_split_change_cb(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
|
||||||
|
|
||||||
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
/* Only INSERT/DELETE/UPDATE actions are visible in the replication path of split shard */
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
ereport(ERROR, errmsg(
|
ereport(ERROR, errmsg(
|
||||||
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
"Unexpected Action :%d. Expected action is INSERT/DELETE/UPDATE",
|
||||||
change->action));
|
change->action));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -541,7 +541,8 @@ StatCountersShmemInit(void)
|
||||||
SharedBackendStatsSlotArray = (BackendStatsSlot *)
|
SharedBackendStatsSlotArray = (BackendStatsSlot *)
|
||||||
ShmemInitStruct("Citus Shared Backend Stats Slot Array",
|
ShmemInitStruct("Citus Shared Backend Stats Slot Array",
|
||||||
SharedBackendStatsSlotArrayShmemSize(),
|
SharedBackendStatsSlotArrayShmemSize(),
|
||||||
&sharedBackendStatsSlotArrayAlreadyInit);
|
&sharedBackendStatsSlotArrayAlreadyInit)
|
||||||
|
;
|
||||||
|
|
||||||
bool sharedSavedBackendStatsHashLockAlreadyInit = false;
|
bool sharedSavedBackendStatsHashLockAlreadyInit = false;
|
||||||
SharedSavedBackendStatsHashLock = ShmemInitStruct(
|
SharedSavedBackendStatsHashLock = ShmemInitStruct(
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@
|
||||||
#include "distributed/shard_rebalancer.h"
|
#include "distributed/shard_rebalancer.h"
|
||||||
|
|
||||||
/* static declarations for json conversion */
|
/* static declarations for json conversion */
|
||||||
static List * JsonArrayToShardPlacementTestInfoList(
|
static List * JsonArrayToShardPlacementTestInfoList(ArrayType *
|
||||||
ArrayType *shardPlacementJsonArrayObject);
|
shardPlacementJsonArrayObject);
|
||||||
static List * JsonArrayToWorkerTestInfoList(ArrayType *workerNodeJsonArrayObject);
|
static List * JsonArrayToWorkerTestInfoList(ArrayType *workerNodeJsonArrayObject);
|
||||||
static bool JsonFieldValueBoolDefault(Datum jsonDocument, const char *key,
|
static bool JsonFieldValueBoolDefault(Datum jsonDocument, const char *key,
|
||||||
bool defaultValue);
|
bool defaultValue);
|
||||||
|
|
|
||||||
|
|
@ -395,8 +395,8 @@ AssociateDistributedTransactionWithBackendProc(TransactionNode *transactionNode)
|
||||||
DistributedTransactionId *currentTransactionId =
|
DistributedTransactionId *currentTransactionId =
|
||||||
¤tBackendData.transactionId;
|
¤tBackendData.transactionId;
|
||||||
|
|
||||||
if (currentTransactionId->transactionNumber !=
|
if (currentTransactionId->transactionNumber != transactionNode->transactionId.
|
||||||
transactionNode->transactionId.transactionNumber)
|
transactionNumber)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -634,8 +634,9 @@ SendMetadataCommandListToWorkerListInCoordinatedTransaction(List *workerNodeList
|
||||||
* false.
|
* false.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
SendOptionalCommandListToWorkerOutsideTransactionWithConnection(
|
SendOptionalCommandListToWorkerOutsideTransactionWithConnection(MultiConnection *
|
||||||
MultiConnection *workerConnection, List *commandList)
|
workerConnection, List *
|
||||||
|
commandList)
|
||||||
{
|
{
|
||||||
if (PQstatus(workerConnection->pgConn) != CONNECTION_OK)
|
if (PQstatus(workerConnection->pgConn) != CONNECTION_OK)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -376,12 +376,12 @@ ExtractAggregationValues(FunctionCallInfo fcinfo, int argumentIndex,
|
||||||
HeapTupleHeader tupleHeader =
|
HeapTupleHeader tupleHeader =
|
||||||
DatumGetHeapTupleHeader(fcGetArgValue(fcinfo, argumentIndex));
|
DatumGetHeapTupleHeader(fcGetArgValue(fcinfo, argumentIndex));
|
||||||
|
|
||||||
if (HeapTupleHeaderGetNatts(tupleHeader) !=
|
if (HeapTupleHeaderGetNatts(tupleHeader) != aggregationArgumentContext->
|
||||||
aggregationArgumentContext->argumentCount ||
|
argumentCount ||
|
||||||
HeapTupleHeaderGetTypeId(tupleHeader) !=
|
HeapTupleHeaderGetTypeId(tupleHeader) != aggregationArgumentContext->
|
||||||
aggregationArgumentContext->tupleDesc->tdtypeid ||
|
tupleDesc->tdtypeid ||
|
||||||
HeapTupleHeaderGetTypMod(tupleHeader) !=
|
HeapTupleHeaderGetTypMod(tupleHeader) != aggregationArgumentContext->
|
||||||
aggregationArgumentContext->tupleDesc->tdtypmod)
|
tupleDesc->tdtypmod)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("worker_partial_agg_sfunc received "
|
ereport(ERROR, (errmsg("worker_partial_agg_sfunc received "
|
||||||
"incompatible record")));
|
"incompatible record")));
|
||||||
|
|
@ -818,7 +818,8 @@ coord_combine_agg_ffunc(PG_FUNCTION_ARGS)
|
||||||
if (!TypecheckCoordCombineAggReturnType(fcinfo, ffunc, box))
|
if (!TypecheckCoordCombineAggReturnType(fcinfo, ffunc, box))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg(
|
ereport(ERROR, (errmsg(
|
||||||
"coord_combine_agg_ffunc could not confirm type correctness")));
|
"coord_combine_agg_ffunc could not confirm type correctness"))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ffunc == InvalidOid)
|
if (ffunc == InvalidOid)
|
||||||
|
|
|
||||||
|
|
@ -88,26 +88,26 @@ static shm_mq_result ConsumeTaskWorkerOutput(shm_mq_handle *responseq, StringInf
|
||||||
bool *hadError);
|
bool *hadError);
|
||||||
static void UpdateDependingTasks(BackgroundTask *task);
|
static void UpdateDependingTasks(BackgroundTask *task);
|
||||||
static int64 CalculateBackoffDelay(int retryCount);
|
static int64 CalculateBackoffDelay(int retryCount);
|
||||||
static bool NewExecutorExceedsCitusLimit(
|
static bool NewExecutorExceedsCitusLimit(QueueMonitorExecutionContext *
|
||||||
QueueMonitorExecutionContext *queueMonitorExecutionContext);
|
queueMonitorExecutionContext);
|
||||||
static bool NewExecutorExceedsPgMaxWorkers(BackgroundWorkerHandle *handle,
|
static bool NewExecutorExceedsPgMaxWorkers(BackgroundWorkerHandle *handle,
|
||||||
QueueMonitorExecutionContext *
|
QueueMonitorExecutionContext *
|
||||||
queueMonitorExecutionContext);
|
queueMonitorExecutionContext);
|
||||||
static bool AssignRunnableTaskToNewExecutor(BackgroundTask *runnableTask,
|
static bool AssignRunnableTaskToNewExecutor(BackgroundTask *runnableTask,
|
||||||
QueueMonitorExecutionContext *
|
QueueMonitorExecutionContext *
|
||||||
queueMonitorExecutionContext);
|
queueMonitorExecutionContext);
|
||||||
static void AssignRunnableTasks(
|
static void AssignRunnableTasks(QueueMonitorExecutionContext *queueMonitorExecutionContext
|
||||||
QueueMonitorExecutionContext *queueMonitorExecutionContext);
|
);
|
||||||
static List * GetRunningTaskEntries(HTAB *currentExecutors);
|
static List * GetRunningTaskEntries(HTAB *currentExecutors);
|
||||||
static shm_mq_result ReadFromExecutorQueue(
|
static shm_mq_result ReadFromExecutorQueue(BackgroundExecutorHashEntry *
|
||||||
BackgroundExecutorHashEntry *backgroundExecutorHashEntry,
|
backgroundExecutorHashEntry,
|
||||||
bool *hadError);
|
bool *hadError);
|
||||||
static void CheckAndResetLastWorkerAllocationFailure(
|
static void CheckAndResetLastWorkerAllocationFailure(QueueMonitorExecutionContext *
|
||||||
QueueMonitorExecutionContext *queueMonitorExecutionContext);
|
queueMonitorExecutionContext);
|
||||||
static TaskExecutionStatus TaskConcurrentCancelCheck(
|
static TaskExecutionStatus TaskConcurrentCancelCheck(TaskExecutionContext *
|
||||||
TaskExecutionContext *taskExecutionContext);
|
taskExecutionContext);
|
||||||
static TaskExecutionStatus ConsumeExecutorQueue(
|
static TaskExecutionStatus ConsumeExecutorQueue(TaskExecutionContext *taskExecutionContext
|
||||||
TaskExecutionContext *taskExecutionContext);
|
);
|
||||||
static void TaskHadError(TaskExecutionContext *taskExecutionContext);
|
static void TaskHadError(TaskExecutionContext *taskExecutionContext);
|
||||||
static void TaskEnded(TaskExecutionContext *taskExecutionContext);
|
static void TaskEnded(TaskExecutionContext *taskExecutionContext);
|
||||||
static void TerminateAllTaskExecutors(HTAB *currentExecutors);
|
static void TerminateAllTaskExecutors(HTAB *currentExecutors);
|
||||||
|
|
@ -537,7 +537,8 @@ NewExecutorExceedsPgMaxWorkers(BackgroundWorkerHandle *handle,
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
AssignRunnableTaskToNewExecutor(BackgroundTask *runnableTask,
|
AssignRunnableTaskToNewExecutor(BackgroundTask *runnableTask,
|
||||||
QueueMonitorExecutionContext *queueMonitorExecutionContext)
|
QueueMonitorExecutionContext *queueMonitorExecutionContext
|
||||||
|
)
|
||||||
{
|
{
|
||||||
Assert(runnableTask && runnableTask->status == BACKGROUND_TASK_STATUS_RUNNABLE);
|
Assert(runnableTask && runnableTask->status == BACKGROUND_TASK_STATUS_RUNNABLE);
|
||||||
|
|
||||||
|
|
@ -649,8 +650,8 @@ GetRunningTaskEntries(HTAB *currentExecutors)
|
||||||
* It also resets the failure timestamp.
|
* It also resets the failure timestamp.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
CheckAndResetLastWorkerAllocationFailure(
|
CheckAndResetLastWorkerAllocationFailure(QueueMonitorExecutionContext *
|
||||||
QueueMonitorExecutionContext *queueMonitorExecutionContext)
|
queueMonitorExecutionContext)
|
||||||
{
|
{
|
||||||
if (queueMonitorExecutionContext->backgroundWorkerFailedStartTime > 0)
|
if (queueMonitorExecutionContext->backgroundWorkerFailedStartTime > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -531,8 +531,8 @@ ColocationId(int shardCount, int replicationFactor, Oid distributionColumnType,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colocationId == INVALID_COLOCATION_ID || colocationId >
|
if (colocationId == INVALID_COLOCATION_ID || colocationId > colocationForm->
|
||||||
colocationForm->colocationid)
|
colocationid)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We assign the smallest colocation id among all the matches so that we
|
* We assign the smallest colocation id among all the matches so that we
|
||||||
|
|
@ -1051,8 +1051,8 @@ ColocatedShardIntervalList(ShardInterval *shardInterval)
|
||||||
* Since we iterate over co-located tables, shard count of each table should be
|
* Since we iterate over co-located tables, shard count of each table should be
|
||||||
* same and greater than shardIntervalIndex.
|
* same and greater than shardIntervalIndex.
|
||||||
*/
|
*/
|
||||||
Assert(cacheEntry->shardIntervalArrayLength ==
|
Assert(cacheEntry->shardIntervalArrayLength == colocatedTableCacheEntry->
|
||||||
colocatedTableCacheEntry->shardIntervalArrayLength);
|
shardIntervalArrayLength);
|
||||||
|
|
||||||
ShardInterval *colocatedShardInterval =
|
ShardInterval *colocatedShardInterval =
|
||||||
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
||||||
|
|
@ -1122,8 +1122,8 @@ ColocatedNonPartitionShardIntervalList(ShardInterval *shardInterval)
|
||||||
* Since we iterate over co-located tables, shard count of each table should be
|
* Since we iterate over co-located tables, shard count of each table should be
|
||||||
* same and greater than shardIntervalIndex.
|
* same and greater than shardIntervalIndex.
|
||||||
*/
|
*/
|
||||||
Assert(cacheEntry->shardIntervalArrayLength ==
|
Assert(cacheEntry->shardIntervalArrayLength == colocatedTableCacheEntry->
|
||||||
colocatedTableCacheEntry->shardIntervalArrayLength);
|
shardIntervalArrayLength);
|
||||||
|
|
||||||
ShardInterval *colocatedShardInterval =
|
ShardInterval *colocatedShardInterval =
|
||||||
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
colocatedTableCacheEntry->sortedShardIntervalArray[shardIntervalIndex];
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,8 @@ static List * GetRelationshipNodesForFKeyConnectedRelations(
|
||||||
static List * GetAllNeighboursList(ForeignConstraintRelationshipNode *relationshipNode);
|
static List * GetAllNeighboursList(ForeignConstraintRelationshipNode *relationshipNode);
|
||||||
static ForeignConstraintRelationshipNode * GetRelationshipNodeForRelationId(Oid
|
static ForeignConstraintRelationshipNode * GetRelationshipNodeForRelationId(Oid
|
||||||
relationId,
|
relationId,
|
||||||
bool *isFound);
|
bool *isFound)
|
||||||
|
;
|
||||||
static void CreateForeignConstraintRelationshipGraph(void);
|
static void CreateForeignConstraintRelationshipGraph(void);
|
||||||
static bool IsForeignConstraintRelationshipGraphValid(void);
|
static bool IsForeignConstraintRelationshipGraphValid(void);
|
||||||
static List * GetNeighbourList(ForeignConstraintRelationshipNode *relationshipNode,
|
static List * GetNeighbourList(ForeignConstraintRelationshipNode *relationshipNode,
|
||||||
|
|
@ -177,8 +178,8 @@ ShouldUndistributeCitusLocalTable(Oid relationId)
|
||||||
* to given relation node via a foreign key relationhip graph.
|
* to given relation node via a foreign key relationhip graph.
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
GetRelationshipNodesForFKeyConnectedRelations(
|
GetRelationshipNodesForFKeyConnectedRelations(ForeignConstraintRelationshipNode *
|
||||||
ForeignConstraintRelationshipNode *relationshipNode)
|
relationshipNode)
|
||||||
{
|
{
|
||||||
HTAB *oidVisitedMap = CreateSimpleHashSetWithName(Oid, "oid visited hash set");
|
HTAB *oidVisitedMap = CreateSimpleHashSetWithName(Oid, "oid visited hash set");
|
||||||
|
|
||||||
|
|
@ -566,8 +567,8 @@ PopulateAdjacencyLists(void)
|
||||||
/* we just saw this edge, no need to add it twice */
|
/* we just saw this edge, no need to add it twice */
|
||||||
if (currentFConstraintRelationshipEdge->referencingRelationOID ==
|
if (currentFConstraintRelationshipEdge->referencingRelationOID ==
|
||||||
prevReferencingOid &&
|
prevReferencingOid &&
|
||||||
currentFConstraintRelationshipEdge->referencedRelationOID ==
|
currentFConstraintRelationshipEdge->referencedRelationOID == prevReferencedOid
|
||||||
prevReferencedOid)
|
)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,12 @@ static void CreateFixPartitionShardIndexNames(Oid parentRelationId,
|
||||||
static List * WorkerFixPartitionShardIndexNamesCommandList(uint64 parentShardId,
|
static List * WorkerFixPartitionShardIndexNamesCommandList(uint64 parentShardId,
|
||||||
List *indexIdList,
|
List *indexIdList,
|
||||||
Oid partitionRelationId);
|
Oid partitionRelationId);
|
||||||
static List * WorkerFixPartitionShardIndexNamesCommandListForParentShardIndex(
|
static List * WorkerFixPartitionShardIndexNamesCommandListForParentShardIndex(char *
|
||||||
char *qualifiedParentShardIndexName, Oid parentIndexId, Oid partitionRelationId);
|
qualifiedParentShardIndexName,
|
||||||
|
Oid
|
||||||
|
parentIndexId,
|
||||||
|
Oid
|
||||||
|
partitionRelationId);
|
||||||
static List * WorkerFixPartitionShardIndexNamesCommandListForPartitionIndex(Oid
|
static List * WorkerFixPartitionShardIndexNamesCommandListForPartitionIndex(Oid
|
||||||
partitionIndexId,
|
partitionIndexId,
|
||||||
char *
|
char *
|
||||||
|
|
@ -652,8 +656,10 @@ WorkerFixPartitionShardIndexNamesCommandList(uint64 parentShardId,
|
||||||
* given partition. Otherwise, all the partitions are included.
|
* given partition. Otherwise, all the partitions are included.
|
||||||
*/
|
*/
|
||||||
static List *
|
static List *
|
||||||
WorkerFixPartitionShardIndexNamesCommandListForParentShardIndex(
|
WorkerFixPartitionShardIndexNamesCommandListForParentShardIndex(char *
|
||||||
char *qualifiedParentShardIndexName, Oid parentIndexId, Oid partitionRelationId)
|
qualifiedParentShardIndexName,
|
||||||
|
Oid parentIndexId, Oid
|
||||||
|
partitionRelationId)
|
||||||
{
|
{
|
||||||
List *commandList = NIL;
|
List *commandList = NIL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ extern char * pg_get_serverdef_string(Oid tableRelationId);
|
||||||
extern char * pg_get_sequencedef_string(Oid sequenceRelid);
|
extern char * pg_get_sequencedef_string(Oid sequenceRelid);
|
||||||
extern Form_pg_sequence pg_get_sequencedef(Oid sequenceRelationId);
|
extern Form_pg_sequence pg_get_sequencedef(Oid sequenceRelationId);
|
||||||
extern char * pg_get_tableschemadef_string(Oid tableRelationId,
|
extern char * pg_get_tableschemadef_string(Oid tableRelationId,
|
||||||
IncludeSequenceDefaults includeSequenceDefaults,
|
IncludeSequenceDefaults includeSequenceDefaults
|
||||||
|
,
|
||||||
IncludeIdentities includeIdentityDefaults,
|
IncludeIdentities includeIdentityDefaults,
|
||||||
char *accessMethod);
|
char *accessMethod);
|
||||||
extern void EnsureRelationKindSupported(Oid relationId);
|
extern void EnsureRelationKindSupported(Oid relationId);
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,8 @@ extern void SwitchToSequentialAndLocalExecutionIfRelationNameTooLong(Oid relatio
|
||||||
extern void SwitchToSequentialAndLocalExecutionIfPartitionNameTooLong(Oid
|
extern void SwitchToSequentialAndLocalExecutionIfPartitionNameTooLong(Oid
|
||||||
parentRelationId,
|
parentRelationId,
|
||||||
Oid
|
Oid
|
||||||
partitionRelationId);
|
partitionRelationId)
|
||||||
|
;
|
||||||
|
|
||||||
/* DistOpsOperationType to be used in DistributeObjectOps */
|
/* DistOpsOperationType to be used in DistributeObjectOps */
|
||||||
typedef enum DistOpsOperationType
|
typedef enum DistOpsOperationType
|
||||||
|
|
@ -560,13 +561,15 @@ extern List * PreprocessAlterSequenceSchemaStmt(Node *node, const char *queryStr
|
||||||
processUtilityContext);
|
processUtilityContext);
|
||||||
extern List * PostprocessAlterSequenceSchemaStmt(Node *node, const char *queryString);
|
extern List * PostprocessAlterSequenceSchemaStmt(Node *node, const char *queryString);
|
||||||
extern List * PreprocessAlterSequenceOwnerStmt(Node *node, const char *queryString,
|
extern List * PreprocessAlterSequenceOwnerStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext
|
||||||
|
);
|
||||||
extern List * PostprocessAlterSequenceOwnerStmt(Node *node, const char *queryString);
|
extern List * PostprocessAlterSequenceOwnerStmt(Node *node, const char *queryString);
|
||||||
extern List * PreprocessAlterSequencePersistenceStmt(Node *node, const char *queryString,
|
extern List * PreprocessAlterSequencePersistenceStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext
|
ProcessUtilityContext
|
||||||
processUtilityContext);
|
processUtilityContext);
|
||||||
extern List * PreprocessSequenceAlterTableStmt(Node *node, const char *queryString,
|
extern List * PreprocessSequenceAlterTableStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext
|
||||||
|
);
|
||||||
extern List * PreprocessDropSequenceStmt(Node *node, const char *queryString,
|
extern List * PreprocessDropSequenceStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext);
|
||||||
extern List * SequenceDropStmtObjectAddress(Node *stmt, bool missing_ok, bool
|
extern List * SequenceDropStmtObjectAddress(Node *stmt, bool missing_ok, bool
|
||||||
|
|
@ -639,7 +642,8 @@ extern void PrepareAlterTableStmtForConstraint(AlterTableStmt *alterTableStateme
|
||||||
extern List * PreprocessAlterTableStmt(Node *node, const char *alterTableCommand,
|
extern List * PreprocessAlterTableStmt(Node *node, const char *alterTableCommand,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext);
|
||||||
extern List * PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString,
|
extern List * PreprocessAlterTableMoveAllStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext)
|
||||||
|
;
|
||||||
extern List * PreprocessAlterTableSchemaStmt(Node *node, const char *queryString,
|
extern List * PreprocessAlterTableSchemaStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext processUtilityContext);
|
ProcessUtilityContext processUtilityContext);
|
||||||
extern void SkipForeignKeyValidationIfConstraintIsFkey(AlterTableStmt *alterTableStmt,
|
extern void SkipForeignKeyValidationIfConstraintIsFkey(AlterTableStmt *alterTableStmt,
|
||||||
|
|
@ -789,8 +793,8 @@ extern List * PostprocessAlterTriggerDependsStmt(Node *node, const char *querySt
|
||||||
extern List * PreprocessAlterTriggerDependsStmt(Node *node, const char *queryString,
|
extern List * PreprocessAlterTriggerDependsStmt(Node *node, const char *queryString,
|
||||||
ProcessUtilityContext
|
ProcessUtilityContext
|
||||||
processUtilityContext);
|
processUtilityContext);
|
||||||
extern void AlterTriggerDependsEventExtendNames(
|
extern void AlterTriggerDependsEventExtendNames(AlterObjectDependsStmt *
|
||||||
AlterObjectDependsStmt *alterTriggerDependsStmt,
|
alterTriggerDependsStmt,
|
||||||
char *schemaName, uint64 shardId);
|
char *schemaName, uint64 shardId);
|
||||||
extern void ErrorOutForTriggerIfNotSupported(Oid relationId);
|
extern void ErrorOutForTriggerIfNotSupported(Oid relationId);
|
||||||
extern void ErrorIfRelationHasUnsupportedTrigger(Oid relationId);
|
extern void ErrorIfRelationHasUnsupportedTrigger(Oid relationId);
|
||||||
|
|
@ -834,8 +838,9 @@ extern bool RelationIdListHasReferenceTable(List *relationIdList);
|
||||||
extern List * GetFKeyCreationCommandsForRelationIdList(List *relationIdList);
|
extern List * GetFKeyCreationCommandsForRelationIdList(List *relationIdList);
|
||||||
extern void DropRelationForeignKeys(Oid relationId, int flags);
|
extern void DropRelationForeignKeys(Oid relationId, int flags);
|
||||||
extern void SetLocalEnableLocalReferenceForeignKeys(bool state);
|
extern void SetLocalEnableLocalReferenceForeignKeys(bool state);
|
||||||
extern void ExecuteAndLogUtilityCommandListInTableTypeConversionViaSPI(
|
extern void ExecuteAndLogUtilityCommandListInTableTypeConversionViaSPI(List *
|
||||||
List *utilityCommandList);
|
utilityCommandList)
|
||||||
|
;
|
||||||
extern void ExecuteAndLogUtilityCommandList(List *ddlCommandList);
|
extern void ExecuteAndLogUtilityCommandList(List *ddlCommandList);
|
||||||
extern void ExecuteAndLogUtilityCommand(const char *commandString);
|
extern void ExecuteAndLogUtilityCommand(const char *commandString);
|
||||||
extern void ExecuteForeignKeyCreateCommandList(List *ddlCommandList,
|
extern void ExecuteForeignKeyCreateCommandList(List *ddlCommandList,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,8 @@
|
||||||
#define WORKER_APPLY_SHARD_DDL_COMMAND_WITHOUT_SCHEMA \
|
#define WORKER_APPLY_SHARD_DDL_COMMAND_WITHOUT_SCHEMA \
|
||||||
"SELECT worker_apply_shard_ddl_command (" UINT64_FORMAT ", %s)"
|
"SELECT worker_apply_shard_ddl_command (" UINT64_FORMAT ", %s)"
|
||||||
#define WORKER_APPLY_INTER_SHARD_DDL_COMMAND \
|
#define WORKER_APPLY_INTER_SHARD_DDL_COMMAND \
|
||||||
"SELECT worker_apply_inter_shard_ddl_command (" UINT64_FORMAT ", %s, " UINT64_FORMAT \
|
"SELECT worker_apply_inter_shard_ddl_command (" UINT64_FORMAT \
|
||||||
|
", %s, " UINT64_FORMAT \
|
||||||
", %s, %s)"
|
", %s, %s)"
|
||||||
#define SHARD_RANGE_QUERY "SELECT min(%s), max(%s) FROM %s"
|
#define SHARD_RANGE_QUERY "SELECT min(%s), max(%s) FROM %s"
|
||||||
#define SHARD_TABLE_SIZE_QUERY "SELECT pg_table_size(%s)"
|
#define SHARD_TABLE_SIZE_QUERY "SELECT pg_table_size(%s)"
|
||||||
|
|
@ -225,7 +226,8 @@ extern uint64 GetNextShardId(void);
|
||||||
extern uint64 GetNextPlacementId(void);
|
extern uint64 GetNextPlacementId(void);
|
||||||
extern Oid ResolveRelationId(text *relationName, bool missingOk);
|
extern Oid ResolveRelationId(text *relationName, bool missingOk);
|
||||||
extern List * GetFullTableCreationCommands(Oid relationId,
|
extern List * GetFullTableCreationCommands(Oid relationId,
|
||||||
IncludeSequenceDefaults includeSequenceDefaults,
|
IncludeSequenceDefaults includeSequenceDefaults
|
||||||
|
,
|
||||||
IncludeIdentities includeIdentityDefaults,
|
IncludeIdentities includeIdentityDefaults,
|
||||||
bool creatingShellTableOnRemoteNode);
|
bool creatingShellTableOnRemoteNode);
|
||||||
extern List * GetPostLoadTableCreationCommands(Oid relationId, bool includeIndexes,
|
extern List * GetPostLoadTableCreationCommands(Oid relationId, bool includeIndexes,
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,9 @@ typedef struct ExtendedOpNodeProperties
|
||||||
} ExtendedOpNodeProperties;
|
} ExtendedOpNodeProperties;
|
||||||
|
|
||||||
|
|
||||||
extern ExtendedOpNodeProperties BuildExtendedOpNodeProperties(
|
extern ExtendedOpNodeProperties BuildExtendedOpNodeProperties(MultiExtendedOp *
|
||||||
MultiExtendedOp *extendedOpNode, bool hasNonDistributableAggregates);
|
extendedOpNode, bool
|
||||||
|
hasNonDistributableAggregates);
|
||||||
|
|
||||||
|
|
||||||
#endif /* EXTENDED_OP_NODE_UTILS_H_ */
|
#endif /* EXTENDED_OP_NODE_UTILS_H_ */
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,8 @@ extern List * PartitionTasklistResults(const char *resultIdPrefix, List *selectT
|
||||||
int partitionColumnIndex,
|
int partitionColumnIndex,
|
||||||
CitusTableCacheEntry *distributionScheme,
|
CitusTableCacheEntry *distributionScheme,
|
||||||
bool binaryFormat);
|
bool binaryFormat);
|
||||||
extern char * QueryStringForFragmentsTransfer(
|
extern char * QueryStringForFragmentsTransfer(NodeToNodeFragmentsTransfer *
|
||||||
NodeToNodeFragmentsTransfer *fragmentsTransfer);
|
fragmentsTransfer);
|
||||||
extern void ShardMinMaxValueArrays(ShardInterval **shardIntervalArray, int shardCount,
|
extern void ShardMinMaxValueArrays(ShardInterval **shardIntervalArray, int shardCount,
|
||||||
Oid intervalTypeId, ArrayType **minValueArray,
|
Oid intervalTypeId, ArrayType **minValueArray,
|
||||||
ArrayType **maxValueArray);
|
ArrayType **maxValueArray);
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,8 @@ extern ShardPlacement * ShardPlacementForFunctionColocatedWithDistTable(
|
||||||
DistObjectCacheEntry *procedure, List *argumentList, Var *partitionColumn,
|
DistObjectCacheEntry *procedure, List *argumentList, Var *partitionColumn,
|
||||||
CitusTableCacheEntry
|
CitusTableCacheEntry
|
||||||
*cacheEntry,
|
*cacheEntry,
|
||||||
PlannedStmt *plan);
|
PlannedStmt *plan)
|
||||||
|
;
|
||||||
extern bool CitusHasBeenLoaded(void);
|
extern bool CitusHasBeenLoaded(void);
|
||||||
extern bool CheckCitusVersion(int elevel);
|
extern bool CheckCitusVersion(int elevel);
|
||||||
extern bool CheckAvailableVersion(int elevel);
|
extern bool CheckAvailableVersion(int elevel);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ extern MultiConnection * StartPlacementConnection(uint32 flags,
|
||||||
struct ShardPlacement *placement,
|
struct ShardPlacement *placement,
|
||||||
const char *userName);
|
const char *userName);
|
||||||
extern MultiConnection * GetConnectionIfPlacementAccessedInXact(int flags,
|
extern MultiConnection * GetConnectionIfPlacementAccessedInXact(int flags,
|
||||||
List *placementAccessList,
|
List *placementAccessList
|
||||||
|
,
|
||||||
const char *userName);
|
const char *userName);
|
||||||
extern MultiConnection * StartPlacementListConnection(uint32 flags,
|
extern MultiConnection * StartPlacementListConnection(uint32 flags,
|
||||||
List *placementAccessList,
|
List *placementAccessList,
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ extern int ValuesMaterializationThreshold;
|
||||||
|
|
||||||
extern bool CanPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLimit);
|
extern bool CanPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLimit);
|
||||||
extern bool ShouldUseSubqueryPushDown(Query *originalQuery, Query *rewrittenQuery,
|
extern bool ShouldUseSubqueryPushDown(Query *originalQuery, Query *rewrittenQuery,
|
||||||
PlannerRestrictionContext *plannerRestrictionContext);
|
PlannerRestrictionContext *plannerRestrictionContext
|
||||||
|
);
|
||||||
extern bool JoinTreeContainsSubquery(Query *query);
|
extern bool JoinTreeContainsSubquery(Query *query);
|
||||||
extern bool IsNodeSubquery(Node *node);
|
extern bool IsNodeSubquery(Node *node);
|
||||||
extern bool HasEmptyJoinTree(Query *query);
|
extern bool HasEmptyJoinTree(Query *query);
|
||||||
|
|
@ -37,8 +38,8 @@ extern MultiNode * SubqueryMultiNodeTree(Query *originalQuery,
|
||||||
Query *queryTree,
|
Query *queryTree,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
extern DeferredErrorMessage * DeferErrorIfUnsupportedSubqueryPushdown(
|
extern DeferredErrorMessage * DeferErrorIfUnsupportedSubqueryPushdown(Query *originalQuery
|
||||||
Query *originalQuery,
|
,
|
||||||
PlannerRestrictionContext
|
PlannerRestrictionContext
|
||||||
*
|
*
|
||||||
plannerRestrictionContext,
|
plannerRestrictionContext,
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ typedef struct RangeTblEntryIndex
|
||||||
Index rteIndex;
|
Index rteIndex;
|
||||||
}RangeTblEntryIndex;
|
}RangeTblEntryIndex;
|
||||||
|
|
||||||
extern PlannerRestrictionContext * GetPlannerRestrictionContext(
|
extern PlannerRestrictionContext * GetPlannerRestrictionContext(RecursivePlanningContext *
|
||||||
RecursivePlanningContext *recursivePlanningContext);
|
recursivePlanningContext);
|
||||||
extern List * GenerateSubplansForSubqueriesAndCTEs(uint64 planId, Query *originalQuery,
|
extern List * GenerateSubplansForSubqueriesAndCTEs(uint64 planId, Query *originalQuery,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext,
|
plannerRestrictionContext,
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ extern PlannerRestrictionContext * FilterPlannerRestrictionForQuery(
|
||||||
extern List * GetRestrictInfoListForRelation(RangeTblEntry *rangeTblEntry,
|
extern List * GetRestrictInfoListForRelation(RangeTblEntry *rangeTblEntry,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
extern RelationRestriction * RelationRestrictionForRelation(
|
extern RelationRestriction * RelationRestrictionForRelation(RangeTblEntry *rangeTableEntry
|
||||||
RangeTblEntry *rangeTableEntry,
|
,
|
||||||
PlannerRestrictionContext *
|
PlannerRestrictionContext *
|
||||||
plannerRestrictionContext);
|
plannerRestrictionContext);
|
||||||
extern JoinRestrictionContext * RemoveDuplicateJoinRestrictions(JoinRestrictionContext *
|
extern JoinRestrictionContext * RemoveDuplicateJoinRestrictions(JoinRestrictionContext *
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ extern List * GenerateTaskListWithColocatedIntermediateResults(Oid targetRelatio
|
||||||
Query *
|
Query *
|
||||||
modifyQueryViaCoordinatorOrRepartition,
|
modifyQueryViaCoordinatorOrRepartition,
|
||||||
char *resultIdPrefix);
|
char *resultIdPrefix);
|
||||||
extern List * GenerateTaskListWithRedistributedResults(
|
extern List * GenerateTaskListWithRedistributedResults(Query *
|
||||||
Query *modifyQueryViaCoordinatorOrRepartition,
|
modifyQueryViaCoordinatorOrRepartition,
|
||||||
CitusTableCacheEntry *
|
CitusTableCacheEntry *
|
||||||
targetRelation,
|
targetRelation,
|
||||||
List **redistributedResults,
|
List **redistributedResults,
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,8 @@ IsNodeWideObjectClass(ObjectClass objectClass)
|
||||||
* this assertion check based on latest supported major Postgres version.
|
* this assertion check based on latest supported major Postgres version.
|
||||||
*/
|
*/
|
||||||
StaticAssertStmt(PG_MAJORVERSION_NUM <= 18,
|
StaticAssertStmt(PG_MAJORVERSION_NUM <= 18,
|
||||||
"better to check if any of newly added ObjectClass'es are node-wide");
|
"better to check if any of newly added ObjectClass'es are node-wide")
|
||||||
|
;
|
||||||
|
|
||||||
switch (objectClass)
|
switch (objectClass)
|
||||||
{
|
{
|
||||||
|
|
@ -187,9 +188,11 @@ IsNodeWideObjectClass(ObjectClass objectClass)
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ typedef struct SortShardIntervalContext
|
||||||
|
|
||||||
extern ShardInterval ** SortShardIntervalArray(ShardInterval **shardIntervalArray, int
|
extern ShardInterval ** SortShardIntervalArray(ShardInterval **shardIntervalArray, int
|
||||||
shardCount, Oid collation,
|
shardCount, Oid collation,
|
||||||
FmgrInfo *shardIntervalSortCompareFunction);
|
FmgrInfo *shardIntervalSortCompareFunction)
|
||||||
|
;
|
||||||
extern int CompareShardIntervals(const void *leftElement, const void *rightElement,
|
extern int CompareShardIntervals(const void *leftElement, const void *rightElement,
|
||||||
SortShardIntervalContext *sortContext);
|
SortShardIntervalContext *sortContext);
|
||||||
extern int CompareShardIntervalsById(const void *leftElement, const void *rightElement);
|
extern int CompareShardIntervalsById(const void *leftElement, const void *rightElement);
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,10 @@ extern List * PopulateShardSplitSubscriptionsMetadataList(HTAB *shardSplitInfoHa
|
||||||
List *
|
List *
|
||||||
shardGroupSplitIntervalListList,
|
shardGroupSplitIntervalListList,
|
||||||
List *workersForPlacementList);
|
List *workersForPlacementList);
|
||||||
extern HTAB * CreateShardSplitInfoMapForPublication(
|
extern HTAB * CreateShardSplitInfoMapForPublication(List *
|
||||||
List *sourceColocatedShardIntervalList,
|
sourceColocatedShardIntervalList,
|
||||||
List *shardGroupSplitIntervalListList,
|
List *shardGroupSplitIntervalListList
|
||||||
|
,
|
||||||
List *destinationWorkerNodesList);
|
List *destinationWorkerNodesList);
|
||||||
|
|
||||||
/* Functions to drop publisher-subscriber resources */
|
/* Functions to drop publisher-subscriber resources */
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,8 @@ void StoreShardSplitSharedMemoryHandle(dsm_handle dsmHandle);
|
||||||
/* Functions for creating and accessing shared memory segments consisting shard split information */
|
/* Functions for creating and accessing shared memory segments consisting shard split information */
|
||||||
extern ShardSplitInfoSMHeader * CreateSharedMemoryForShardSplitInfo(int
|
extern ShardSplitInfoSMHeader * CreateSharedMemoryForShardSplitInfo(int
|
||||||
shardSplitInfoCount,
|
shardSplitInfoCount,
|
||||||
dsm_handle *dsmHandle);
|
dsm_handle *dsmHandle)
|
||||||
|
;
|
||||||
extern void ReleaseSharedMemoryOfShardSplitInfo(void);
|
extern void ReleaseSharedMemoryOfShardSplitInfo(void);
|
||||||
|
|
||||||
extern ShardSplitInfoSMHeader * GetShardSplitInfoSMHeader(void);
|
extern ShardSplitInfoSMHeader * GetShardSplitInfoSMHeader(void);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@
|
||||||
extern bool EnableBinaryProtocol;
|
extern bool EnableBinaryProtocol;
|
||||||
|
|
||||||
extern DestReceiver * CreateShardCopyDestReceiver(EState *executorState,
|
extern DestReceiver * CreateShardCopyDestReceiver(EState *executorState,
|
||||||
List *destinationShardFullyQualifiedName,
|
List *destinationShardFullyQualifiedName
|
||||||
|
,
|
||||||
uint32_t destinationNodeId);
|
uint32_t destinationNodeId);
|
||||||
|
|
||||||
extern const char * CopyableColumnNamesFromRelationName(const char *schemaName, const
|
extern const char * CopyableColumnNamesFromRelationName(const char *schemaName, const
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,10 @@ extern bool SendOptionalCommandListToWorkerOutsideTransactionWithConnection(
|
||||||
List *
|
List *
|
||||||
commandList);
|
commandList);
|
||||||
extern bool SendOptionalMetadataCommandListToWorkerInCoordinatedTransaction(const
|
extern bool SendOptionalMetadataCommandListToWorkerInCoordinatedTransaction(const
|
||||||
char *nodeName,
|
char *nodeName
|
||||||
int32 nodePort,
|
,
|
||||||
|
int32 nodePort
|
||||||
|
,
|
||||||
const char *
|
const char *
|
||||||
nodeUser,
|
nodeUser,
|
||||||
List *
|
List *
|
||||||
|
|
@ -100,16 +102,17 @@ extern void SendCommandListToWorkerOutsideTransaction(const char *nodeName,
|
||||||
int32 nodePort,
|
int32 nodePort,
|
||||||
const char *nodeUser,
|
const char *nodeUser,
|
||||||
List *commandList);
|
List *commandList);
|
||||||
extern void SendCommandListToWorkerOutsideTransactionWithConnection(
|
extern void SendCommandListToWorkerOutsideTransactionWithConnection(MultiConnection *
|
||||||
MultiConnection *workerConnection,
|
workerConnection,
|
||||||
List *commandList);
|
List *commandList);
|
||||||
extern void SendCommandListToWorkerListWithBareConnections(List *workerConnections,
|
extern void SendCommandListToWorkerListWithBareConnections(List *workerConnections,
|
||||||
List *commandList);
|
List *commandList);
|
||||||
extern void SendMetadataCommandListToWorkerListInCoordinatedTransaction(
|
extern void SendMetadataCommandListToWorkerListInCoordinatedTransaction(List *
|
||||||
List *workerNodeList,
|
workerNodeList,
|
||||||
const char *
|
const char *
|
||||||
nodeUser,
|
nodeUser,
|
||||||
List *commandList);
|
List *commandList)
|
||||||
|
;
|
||||||
extern void RemoveWorkerTransaction(const char *nodeName, int32 nodePort);
|
extern void RemoveWorkerTransaction(const char *nodeName, int32 nodePort);
|
||||||
|
|
||||||
/* helper functions for worker transactions */
|
/* helper functions for worker transactions */
|
||||||
|
|
|
||||||
|
|
@ -364,8 +364,10 @@ getObjectClass(const ObjectAddress *object)
|
||||||
}
|
}
|
||||||
|
|
||||||
case TransformRelationId:
|
case TransformRelationId:
|
||||||
|
{
|
||||||
return OCLASS_TRANSFORM;
|
return OCLASS_TRANSFORM;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* shouldn't get here */
|
/* shouldn't get here */
|
||||||
elog(ERROR, "unrecognized object class: %u", object->classId);
|
elog(ERROR, "unrecognized object class: %u", object->classId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue