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);
|
Assert(CurrentOperationId != INVALID_OPERATION_ID);
|
||||||
|
|
||||||
StringInfo sequenceName = makeStringInfo();
|
uint64 recordId = GetNextCleanupRecordId();
|
||||||
appendStringInfo(sequenceName, "%s.%s",
|
|
||||||
PG_CATALOG,
|
|
||||||
CLEANUPRECORDID_SEQUENCE_NAME);
|
|
||||||
|
|
||||||
StringInfo command = makeStringInfo();
|
StringInfo command = makeStringInfo();
|
||||||
appendStringInfo(command,
|
appendStringInfo(command,
|
||||||
"INSERT INTO %s.%s "
|
"INSERT INTO %s.%s "
|
||||||
" (record_id, operation_id, object_type, object_name, node_group_id, policy_type) "
|
" (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_CATALOG,
|
||||||
PG_DIST_CLEANUP,
|
PG_DIST_CLEANUP,
|
||||||
sequenceName->data,
|
recordId,
|
||||||
CurrentOperationId,
|
CurrentOperationId,
|
||||||
objectType,
|
objectType,
|
||||||
quote_literal_cstr(objectName),
|
quote_literal_cstr(objectName),
|
||||||
|
|
|
@ -67,7 +67,7 @@ SELECT pg_catalog.citus_split_shard_by_split_points(
|
||||||
SELECT * from pg_dist_cleanup;
|
SELECT * from pg_dist_cleanup;
|
||||||
record_id | operation_id | object_type | object_name | node_group_id | policy_type
|
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)
|
(1 row)
|
||||||
|
|
||||||
-- One of the physical shards should not be deleted, the other one should.
|
-- One of the physical shards should not be deleted, the other one should.
|
||||||
|
|
Loading…
Reference in New Issue