Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8a89513
Bump citus and citus_columnar version to 14.1.0
onurctirtir Mar 17, 2026
c7874b3
Allow "create / drop schema" from any node for distributed-schemas
onurctirtir Jan 15, 2026
5d9748a
Rename Pre/PostprocessAlterDistributedObjectStmt() to Pre/Postprocess…
onurctirtir Oct 24, 2025
3341a40
Allow "alter schema rename to / owner to" from any node for distribut…
onurctirtir Oct 24, 2025
52d9d59
Allow supported forms of "create table" variants from any node to cre…
onurctirtir Nov 11, 2025
404b2ed
Use IsDroppedOrGenerated() at more places and rename TupleDescColumnN…
onurctirtir Jan 6, 2026
7004f0b
Allow "alter table set schema" from any node to move tables into dist…
onurctirtir Nov 12, 2025
5fb06e3
Allow "drop table" from any node for distributed-schema tables
onurctirtir Jan 6, 2026
b301d0c
Add DisableTrackingQueryCountersForPlannedStmt() for distributed Plan…
onurctirtir Jan 13, 2026
91ae542
Avoid incrementing query counters when replicating shard placement fo…
onurctirtir Jan 8, 2026
53e9775
Allow "alter table" from any node for distributed-schema tables
onurctirtir Jan 19, 2026
2d404cb
Add schema_based_sharding_from_workers_a to test distributed-schema /…
onurctirtir Jan 13, 2026
ba6e2b5
Allow propagating "create / drop schema" in general from any node for…
onurctirtir Jan 20, 2026
c09eb1c
Stabilize test helpers to be used
onurctirtir Jan 30, 2026
d00286f
Add more tests for schema based sharding commands supported from any …
onurctirtir Jan 20, 2026
0948b11
Add EnsureCoordinatorUnlessTenantSchema() and use it where appropriate
onurctirtir Feb 10, 2026
9ef4f0a
Allow "create / drop / alter trigger" and not require citus.enable_un…
onurctirtir Feb 9, 2026
9d66697
Allow "create / drop / alter index" from any node for distributed-sch…
onurctirtir Feb 3, 2026
4c5503c
Not try manually propagating test helper views
onurctirtir Feb 16, 2026
bf9c638
Allow "create / drop / alter view" in general from any node
onurctirtir Feb 16, 2026
35c72a5
Reset local group id when removing a node
onurctirtir Mar 2, 2026
a13f4be
Preserve "sequence range" and "nextval" behavior when creating distri…
onurctirtir Mar 2, 2026
f389f3f
Preserve "sequence range" and "nextval" behavior when altering distri…
onurctirtir Mar 2, 2026
66c01e2
Also test sequences with custom settings
onurctirtir Mar 2, 2026
412809f
Update a comment to reflect the removed trigger limitation
onurctirtir Mar 4, 2026
49ddd06
Add a comment about the usages of OUTSIDE_TRANSACTION
onurctirtir Mar 5, 2026
fda4c18
Replace "master_copy_shad_placement" with "citus_copy_shard_placement…
onurctirtir Mar 4, 2026
012c062
Add usual checks for replicate_reference_tables()
onurctirtir Mar 6, 2026
c6b25b4
Directly alter the shard / placement id sequences for tests
onurctirtir Mar 5, 2026
cd2c735
Acquire colocation id lock on the coordinator when the operation is r…
onurctirtir Mar 4, 2026
c6a7d42
Acquire pg_dist_node lock on the coordinator when the operation is ru…
onurctirtir Mar 6, 2026
83992d4
Acquire placement colocation lock on the coordinator when the operati…
onurctirtir Mar 6, 2026
82fcaf1
Properly support replicating reference tables to all nodes when creat…
onurctirtir Mar 6, 2026
406772f
First reset "RESET citus.enable_ddl_propagation" when executing a com…
onurctirtir Mar 11, 2026
a21d478
Add more tests for schema based sharding commands supported from any …
onurctirtir Mar 9, 2026
e0b28e4
Fixup upgrade / downgrade paths
onurctirtir Mar 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for Citus 14.0.0.
# Generated by GNU Autoconf 2.69 for Citus 14.1.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -579,8 +579,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Citus'
PACKAGE_TARNAME='citus'
PACKAGE_VERSION='14.0.0'
PACKAGE_STRING='Citus 14.0.0'
PACKAGE_VERSION='14.1.0'
PACKAGE_STRING='Citus 14.1.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1262,7 +1262,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Citus 14.0.0 to adapt to many kinds of systems.
\`configure' configures Citus 14.1.0 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1324,7 +1324,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Citus 14.0.0:";;
short | recursive ) echo "Configuration of Citus 14.1.0:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1429,7 +1429,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Citus configure 14.0.0
Citus configure 14.1.0
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1912,7 +1912,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by Citus $as_me 14.0.0, which was
It was created by Citus $as_me 14.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -5395,7 +5395,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Citus $as_me 14.0.0, which was
This file was extended by Citus $as_me 14.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5457,7 +5457,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
Citus config.status 14.0.0
Citus config.status 14.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down Expand Up @@ -6162,4 +6162,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# everyone needing autoconf installed, the resulting files are checked
# into the SCM.

AC_INIT([Citus], [14.0.0])
AC_INIT([Citus], [14.1.0])
AC_COPYRIGHT([Copyright (c) Citus Data, Inc.])

# we'll need sed and awk for some of the version commands
Expand Down
2 changes: 1 addition & 1 deletion src/backend/columnar/citus_columnar.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Columnar extension
comment = 'Citus Columnar extension'
default_version = '14.0-1'
default_version = '14.1-1'
module_pathname = '$libdir/citus_columnar'
relocatable = false
schema = pg_catalog
2 changes: 1 addition & 1 deletion src/backend/columnar/mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


#if PG_VERSION_NUM >= PG_VERSION_18
PG_MODULE_MAGIC_EXT(.name = "citus_columnar", .version = "14.0.0");
PG_MODULE_MAGIC_EXT(.name = "citus_columnar", .version = "14.1.0");
#else
PG_MODULE_MAGIC;
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/backend/columnar/sql/citus_columnar--14.0-1--14.1-1.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- citus_columnar--14.0-1--14.1-1
-- bump version to 14.1-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- citus_columnar--14.1-1--14.0-1
-- downgrade version to 14.0-1
6 changes: 3 additions & 3 deletions src/backend/distributed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1819,13 +1819,13 @@ Each field in the struct is documented in the comments within the `DistributeObj

- **Returning tasks for `preprocess` and `postprocess`**: Ensure that either `preprocess` or `postprocess` returns a list of "DDLJob"s. If both functions return non-empty lists, then you would get an assertion failure.

- **Generic `preprocess` and `postprocess` methods**: The generic methods, `PreprocessAlterDistributedObjectStmt` and `PostprocessAlterDistributedObjectStmt`, serve as generic pre and post methods utilized for various statements. Both of these methods find application in distributed object operations.
- **Generic `preprocess` and `postprocess` methods**: The generic methods, `PreprocessAlterDistributedObjectStmtFromCoordinator` and `PostprocessAlterDistributedObjectStmtFromCoordinator`, serve as generic pre and post methods utilized for various statements. Both of these methods find application in distributed object operations.

- The `PreprocessAlterDistributedObjectStmt` method carries out the following operations:
- The `PreprocessAlterDistributedObjectStmtFromCoordinator` method carries out the following operations:
- Performs a qualification operation.
- Deparses the statement and generates a task list.

- As for the `PostprocessAlterDistributedObjectStmt` method, it:
- As for the `PostprocessAlterDistributedObjectStmtFromCoordinator` method, it:
- Invokes the `EnsureAllObjectDependenciesExistOnAllNodes` function to propagate missing dependencies, both on the coordinator and the worker.

- Before defining new `preprocess` or `postprocess` methods, it is advisable to assess whether the generic methods can be employed in your specific case.
Expand Down
2 changes: 1 addition & 1 deletion src/backend/distributed/citus.control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Citus extension
comment = 'Citus distributed database'
default_version = '14.0-1'
default_version = '14.1-1'
module_pathname = '$libdir/citus'
relocatable = false
schema = pg_catalog
4 changes: 3 additions & 1 deletion src/backend/distributed/commands/alter_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,9 @@ CreateCitusTableLike(TableConversionState *con)
.colocateWithTableName = quote_qualified_identifier(con->schemaName,
con->relationName)
};
CreateSingleShardTable(con->newRelationId, colocationParam);
bool allowFromWorkers = false;
CreateSingleShardTable(con->newRelationId, colocationParam,
allowFromWorkers);
}
else
{
Expand Down
77 changes: 62 additions & 15 deletions src/backend/distributed/commands/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
#include "distributed/worker_transaction.h"


static List * PreprocessAlterDistributedObjectStmtInternal(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext,
bool allowFromWorkers);


/*
* PostprocessCreateDistributedObjectFromCatalogStmt is a common function that can be used
* for most objects during their creation phase. After the creation has happened locally
Expand Down Expand Up @@ -104,27 +111,59 @@ PostprocessCreateDistributedObjectFromCatalogStmt(Node *stmt, const char *queryS


/*
* PreprocessAlterDistributedObjectStmt handles any updates to distributed objects by
* creating the fully qualified sql to apply to all workers after checking all
* predconditions that apply to propagating changes.
* PreprocessAlterDistributedObjectStmtFromCoordinator is a wrapper around
* PreprocessAlterDistributedObjectStmtInternal to be used when altering distributed
* objects that we allow altering only from the coordinator.
*/
List *
PreprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt, const char *queryString,
ProcessUtilityContext
processUtilityContext)
{
return PreprocessAlterDistributedObjectStmtInternal(stmt, queryString,
processUtilityContext, false);
}


/*
* PreprocessAlterDistributedObjectStmtFromAnyNode is a wrapper around
* PreprocessAlterDistributedObjectStmtInternal to be used when altering distributed
* objects that we allow altering from any node.
*/
List *
PreprocessAlterDistributedObjectStmtFromAnyNode(Node *stmt,
const char *queryString,
ProcessUtilityContext
processUtilityContext)
{
return PreprocessAlterDistributedObjectStmtInternal(stmt, queryString,
processUtilityContext, true);
}


/*
* PreprocessAlterDistributedObjectStmtInternal handles any updates to distributed
* objects by creating the fully qualified sql to apply to all other nodes after checking
* all predconditions that apply to propagating changes.
*
* Preconditions are (in order):
* - not in a CREATE/ALTER EXTENSION code block
* - citus.enable_metadata_sync is turned on
* - object being altered is distributed
* - any object specific feature flag is turned on when a feature flag is available
*
* Once we conclude to propagate the changes to the workers we make sure that the command
* has been executed on the coordinator and force any ongoing transaction to run in
* Once we conclude to propagate the changes to other nodes we make sure that the command
* has been executed on the local node and force any ongoing transaction to run in
* sequential mode. If any of these steps fail we raise an error to inform the user.
*
* Lastly we recreate a fully qualified version of the original sql and prepare the tasks
* to send these sql commands to the workers. These tasks include instructions to prevent
* to send these sql commands to other nodes. These tasks include instructions to prevent
* recursion of propagation with Citus' MX functionality.
*/
List *
PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext)
static List *
PreprocessAlterDistributedObjectStmtInternal(Node *stmt, const char *queryString,
ProcessUtilityContext processUtilityContext,
bool allowFromWorkers)
{
const DistributeObjectOps *ops = GetDistributeObjectOps(stmt);
Assert(ops != NULL);
Expand All @@ -145,7 +184,15 @@ PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
return NIL;
}

EnsureCoordinator();
if (allowFromWorkers)
{
EnsurePropagationToCoordinator();
}
else
{
EnsureCoordinator();
}

EnsureSequentialMode(ops->objectType);

QualifyTreeNode(stmt);
Expand All @@ -155,14 +202,14 @@ PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
(void *) sql,
ENABLE_DDL_PROPAGATION);

return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
return NodeDDLTaskList(REMOTE_NODES, commands);
}


/*
* PostprocessAlterDistributedObjectStmt is the counter part of
* PreprocessAlterDistributedObjectStmt that should be executed after the object has been
* changed locally.
* PostprocessAlterDistributedObjectStmtFromCoordinator is the counter part of
* PreprocessAlterDistributedObjectStmtFromCoordinator that should be executed after the
* object has been changed locally.
*
* We perform the same precondition checks as before to skip this operation if any of the
* failed during preprocessing. Since we already raised an error on other checks we don't
Expand All @@ -173,7 +220,7 @@ PreprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString,
* they get created on the workers before we send the command list to the workers.
*/
List *
PostprocessAlterDistributedObjectStmt(Node *stmt, const char *queryString)
PostprocessAlterDistributedObjectStmtFromCoordinator(Node *stmt, const char *queryString)
{
const DistributeObjectOps *ops = GetDistributeObjectOps(stmt);
Assert(ops != NULL);
Expand Down
Loading
Loading