mirror of https://github.com/citusdata/citus.git
Apply code review feedback
parent
923bb194a4
commit
72d7d92611
|
@ -437,8 +437,12 @@ AcquireDistributedLockOnRelations(List *relationIdList, LOCKMODE lockMode)
|
||||||
/*
|
/*
|
||||||
* We only acquire distributed lock on relation if
|
* We only acquire distributed lock on relation if
|
||||||
* the relation is sync'ed between mx nodes.
|
* the relation is sync'ed between mx nodes.
|
||||||
|
*
|
||||||
|
* Even if users disable metadata sync, we cannot
|
||||||
|
* allow them not to acquire the remote locks.
|
||||||
|
* Hence, we have !IsCoordinator() check.
|
||||||
*/
|
*/
|
||||||
if (ShouldSyncTableMetadata(relationId))
|
if (ShouldSyncTableMetadata(relationId) || !IsCoordinator())
|
||||||
{
|
{
|
||||||
char *qualifiedRelationName = generate_qualified_relation_name(relationId);
|
char *qualifiedRelationName = generate_qualified_relation_name(relationId);
|
||||||
StringInfo lockRelationCommand = makeStringInfo();
|
StringInfo lockRelationCommand = makeStringInfo();
|
||||||
|
|
|
@ -556,8 +556,12 @@ BlockWritesToShardList(List *shardList)
|
||||||
Oid firstDistributedTableId = firstShardInterval->relationId;
|
Oid firstDistributedTableId = firstShardInterval->relationId;
|
||||||
|
|
||||||
bool shouldSyncMetadata = ShouldSyncTableMetadata(firstDistributedTableId);
|
bool shouldSyncMetadata = ShouldSyncTableMetadata(firstDistributedTableId);
|
||||||
if (shouldSyncMetadata)
|
if (shouldSyncMetadata || !IsCoordinator())
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Even if users disable metadata sync, we cannot allow them not to
|
||||||
|
* acquire the remote locks. Hence, we have !IsCoordinator() check.
|
||||||
|
*/
|
||||||
LockShardListMetadataOnWorkers(ExclusiveLock, shardList);
|
LockShardListMetadataOnWorkers(ExclusiveLock, shardList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ step s2-view-worker:
|
||||||
|
|
||||||
query |query_hostname |query_hostport|distributed_query_host_name|distributed_query_host_port|state |wait_event_type|wait_event|usename |datname
|
query |query_hostname |query_hostport|distributed_query_host_name|distributed_query_host_port|state |wait_event_type|wait_event|usename |datname
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
UPDATE public.ref_table_1500803 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57638|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
UPDATE public.ref_table_1500767 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57638|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
||||||
UPDATE public.ref_table_1500803 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
UPDATE public.ref_table_1500767 ref_table SET a = (a OPERATOR(pg_catalog.+) 1)|localhost | 57637|coordinator_host | 57636|idle in transaction|Client |ClientRead|postgres|regression
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
step s2-end:
|
step s2-end:
|
||||||
|
|
|
@ -89,11 +89,11 @@ test: isolation_ref_update_delete_upsert_vs_all_on_mx
|
||||||
test: isolation_dis2ref_foreign_keys_on_mx
|
test: isolation_dis2ref_foreign_keys_on_mx
|
||||||
test: isolation_metadata_sync_deadlock
|
test: isolation_metadata_sync_deadlock
|
||||||
test: isolation_replicated_dist_on_mx
|
test: isolation_replicated_dist_on_mx
|
||||||
|
test: isolation_replicate_reference_tables_to_coordinator
|
||||||
test: isolation_multiuser_locking
|
test: isolation_multiuser_locking
|
||||||
|
|
||||||
# MXless tests
|
# MXless tests
|
||||||
test: isolation_check_mx
|
test: isolation_check_mx
|
||||||
test: isolation_replicate_reference_tables_to_coordinator
|
|
||||||
test: isolation_turn_mx_off
|
test: isolation_turn_mx_off
|
||||||
test: isolation_reference_copy_vs_all
|
test: isolation_reference_copy_vs_all
|
||||||
test: isolation_ref2ref_foreign_keys
|
test: isolation_ref2ref_foreign_keys
|
||||||
|
|
Loading…
Reference in New Issue