mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
use insert return value to check uniqueness
This commit is contained in:
parent
622f3ebbe1
commit
e06d1fea26
@ -68,11 +68,8 @@ 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())
|
|
||||||
volume_priorities.insert(last_priority);
|
|
||||||
else
|
|
||||||
throw Exception(
|
throw Exception(
|
||||||
ErrorCodes::INVALID_CONFIG_PARAMETER,
|
ErrorCodes::INVALID_CONFIG_PARAMETER,
|
||||||
"volume_priority values must be unique across the policy");
|
"volume_priority values must be unique across the policy");
|
||||||
|
Loading…
Reference in New Issue
Block a user