mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
use insert return value to check uniqueness
This commit is contained in:
parent
622f3ebbe1
commit
e06d1fea26
@ -68,14 +68,11 @@ StoragePolicy::StoragePolicy(
|
|||||||
volumes.emplace_back(createVolumeFromConfig(attr_name, config, volumes_prefix + "." + attr_name, disks));
|
volumes.emplace_back(createVolumeFromConfig(attr_name, config, volumes_prefix + "." + attr_name, disks));
|
||||||
|
|
||||||
UInt64 last_priority = volumes.back()->volume_priority;
|
UInt64 last_priority = volumes.back()->volume_priority;
|
||||||
if (last_priority != std::numeric_limits<UInt64>::max())
|
if (last_priority != std::numeric_limits<UInt64>::max() && !volume_priorities.insert(last_priority).second)
|
||||||
{
|
{
|
||||||
if (volume_priorities.find(last_priority) == volume_priorities.end())
|
throw Exception(
|
||||||
volume_priorities.insert(last_priority);
|
ErrorCodes::INVALID_CONFIG_PARAMETER,
|
||||||
else
|
"volume_priority values must be unique across the policy");
|
||||||
throw Exception(
|
|
||||||
ErrorCodes::INVALID_CONFIG_PARAMETER,
|
|
||||||
"volume_priority values must be unique across the policy");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user