diff --git a/src/backend/distributed/operations/shard_cleaner.c b/src/backend/distributed/operations/shard_cleaner.c index 780e6f22e..81331f1d9 100644 --- a/src/backend/distributed/operations/shard_cleaner.c +++ b/src/backend/distributed/operations/shard_cleaner.c @@ -512,10 +512,11 @@ InsertCleanupRecordInSubtransaction(CleanupObject objectType, StringInfo command = makeStringInfo(); appendStringInfo(command, "INSERT INTO %s.%s " - " (operation_id, object_type, object_name, node_group_id, policy_type) " - " VALUES (" UINT64_FORMAT ", %d, %s, %d, %d)", + " (record_id, operation_id, object_type, object_name, node_group_id, policy_type) " + " VALUES ( nextval('%s'), " UINT64_FORMAT ", %d, %s, %d, %d)", PG_CATALOG, PG_DIST_CLEANUP, + CLEANUPRECORDID_SEQUENCE_NAME, CurrentOperationId, objectType, quote_literal_cstr(objectName), diff --git a/src/backend/distributed/sql/citus--11.0-4--11.1-1.sql b/src/backend/distributed/sql/citus--11.0-4--11.1-1.sql index cb277b1f2..24b08f2f0 100644 --- a/src/backend/distributed/sql/citus--11.0-4--11.1-1.sql +++ b/src/backend/distributed/sql/citus--11.0-4--11.1-1.sql @@ -81,7 +81,7 @@ DROP FUNCTION pg_catalog.isolate_tenant_to_new_shard(table_name regclass, tenant -- 1) Cleanup leftover resources after a failure -- 2) Deferred drop of old shard placements after a split. CREATE TABLE citus.pg_dist_cleanup ( - record_id bigserial primary key, + record_id bigint primary key, operation_id bigint not null, object_type int not null, object_name text not null,