Listing all parts in log have no sense. 
Should be either silenced, either combined into a single line.
throw Exception("Found a part with the same UUID on the same replica.", ErrorCodes::LOGICAL_ERROR);
            }
            selected_parts.push_back(part);
        }
        if (!temp_part_uuids.empty())
        {
            auto duplicates = non_const_context.getPartUUIDs()->add(std::vector<UUID>{temp_part_uuids.begin(), temp_part_uuids.end()});
            if (!duplicates.empty())
            {
                
                
                non_const_context.getIgnoredPartUUIDs()->add(duplicates);
                return false;
            }
        }
        return true;
    };
    
    auto needs_retry = !select_parts(parts);
    
    if (needs_retry)
    {
        LOG_DEBUG(log, "Found duplicate uuids locally, will retry part selection without them");
        
        if (!select_parts(parts))
            throw Exception("Found duplicate UUIDs while processing query.", ErrorCodes::DUPLICATED_PART_UUIDS);
    }
}
}