mirror of https://github.com/citusdata/citus.git
Always use GetNextCleanupRecordId
parent
b2f6cc877f
commit
6f8acfdde7
|
@ -514,19 +514,16 @@ InsertCleanupRecordInSubtransaction(CleanupObject objectType,
|
|||
*/
|
||||
Assert(CurrentOperationId != INVALID_OPERATION_ID);
|
||||
|
||||
StringInfo sequenceName = makeStringInfo();
|
||||
appendStringInfo(sequenceName, "%s.%s",
|
||||
PG_CATALOG,
|
||||
CLEANUPRECORDID_SEQUENCE_NAME);
|
||||
uint64 recordId = GetNextCleanupRecordId();
|
||||
|
||||
StringInfo command = makeStringInfo();
|
||||
appendStringInfo(command,
|
||||
"INSERT INTO %s.%s "
|
||||
" (record_id, operation_id, object_type, object_name, node_group_id, policy_type) "
|
||||
" VALUES ( nextval('%s'), " UINT64_FORMAT ", %d, %s, %d, %d)",
|
||||
" VALUES ( %lu, " UINT64_FORMAT ", %d, %s, %d, %d)",
|
||||
PG_CATALOG,
|
||||
PG_DIST_CLEANUP,
|
||||
sequenceName->data,
|
||||
recordId,
|
||||
CurrentOperationId,
|
||||
objectType,
|
||||
quote_literal_cstr(objectName),
|
||||
|
|
|
@ -67,7 +67,7 @@ SELECT pg_catalog.citus_split_shard_by_split_points(
|
|||
SELECT * from pg_dist_cleanup;
|
||||
record_id | operation_id | object_type | object_name | node_group_id | policy_type
|
||||
---------------------------------------------------------------------
|
||||
512 | 778 | 1 | citus_split_shard_by_split_points_deferred_schema.table_to_split_8981001 | 16 | 2
|
||||
526 | 778 | 1 | citus_split_shard_by_split_points_deferred_schema.table_to_split_8981001 | 16 | 2
|
||||
(1 row)
|
||||
|
||||
-- One of the physical shards should not be deleted, the other one should.
|
||||
|
|
Loading…
Reference in New Issue