Added comments

This commit is contained in:
Igor Nikonov 2023-09-10 20:38:17 +00:00
parent fac0b2f62d
commit 7d630b6b1b
2 changed files with 5 additions and 0 deletions

View File

@ -147,6 +147,9 @@ void SelectStreamFactory::createForShard(
return;
});
// prefer_localhost_replica is not effective in case of parallel replicas
// (1) prefer_localhost_replica is about choosing one replica on a shard
// (2) parallel replica coordinator has own logic to choose replicas to read from
if (settings.prefer_localhost_replica && shard_info.isLocal() && !parallel_replicas_enabled)
{
StoragePtr main_table_storage;

View File

@ -211,6 +211,8 @@ void executeQuery(
}
}
// decide for each shard if parallel reading from replicas should be enabled
// according to settings and number of replicas declared per shard
bool parallel_replicas_enabled = false;
if (shard_info.shard_num > 0 && shard_info.shard_num <= cluster->getShardsAddresses().size())
{