You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "maskit (via GitHub)" <gi...@apache.org> on 2025/10/23 21:22:22 UTC
Re: [PR] Configurable Hash Algorithm and Parameters for Consistent Hash Parent Selection [trafficserver]
maskit commented on code in PR #12567:
URL: https://github.com/apache/trafficserver/pull/12567#discussion_r2457423491
##########
src/proxy/http/remap/NextHopConsistentHash.cc:
##########
@@ -57,17 +57,23 @@ std::shared_ptr<HostRecord>
NextHopConsistentHash::chashLookup(const std::shared_ptr<ATSConsistentHash> &ring, uint32_t cur_ring, ParentResult &result,
HttpRequestData &request_info, bool *wrapped, uint64_t sm_id)
{
- uint64_t hash_key = 0;
- ATSHash64Sip24 hash;
+ uint64_t hash_key = 0;
+ // Create hash instance based on configured algorithm and seeds
+ std::unique_ptr<ATSHash64> hash;
+ if (hash_algorithm == "siphash13") {
Review Comment:
Looks like it's almost a duplication of `ParentConsistentHash::createHashInstance`. Can we have just one place to do this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org