------------------------------------------------------------ revno: 9884 revision-id: squid3@treenet.co.nz-20100212122649-mnxn1hgktz0fuqtu parent: squid3@treenet.co.nz-20100212122225-5znitlg2irkdfqxe committer: Amos Jeffries branch nick: SQUID_3_1 timestamp: Sat 2010-02-13 01:26:49 +1300 message: Author: Jean-Gabriel Dick Bug 1843: multicast-siblings cache_peer option for optimising multicast ICP relations 'multicast-siblings' : this option is meant to be used only for cache peers of type "multicast". It instructs Squid that ALL members of this multicast group have "sibling" relationship with it, not "parent". This is an optimization that avoids useless multicast queries to a multicast group when the requested object would be fetched only from a "parent" cache, anyway. It's useful, e.g., when configuring a pool of redundant Squid proxies, being members of the same multicast group. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20100212122649-mnxn1hgktz0fuqtu # target_branch: http://www.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: ff529dc9e8cbf57664f814d46b52fdefeec30bde # timestamp: 2010-02-12 12:46:35 +0000 # source_branch: http://www.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_1 # base_revision_id: squid3@treenet.co.nz-20100212122225-\ # 5znitlg2irkdfqxe # # Begin patch === modified file 'doc/release-notes/release-3.1.sgml' --- doc/release-notes/release-3.1.sgml 2010-02-01 01:56:03 +0000 +++ doc/release-notes/release-3.1.sgml 2010-02-12 12:26:49 +0000 @@ -955,7 +955,7 @@ cache_mem

Default size increased to 256MB. - cache_peer htcp-no-clr htcp-no-purge-clr htcp-only-clr htcp-forward-clr connection-auth[=on|off|auto] connect-fail-limit=N no-tproxy + cache_peer htcp-no-clr htcp-no-purge-clr htcp-only-clr htcp-forward-clr connection-auth[=on|off|auto] connect-fail-limit=N multicast-siblings no-tproxy

New Options. use 'htcp-no-clr' to send HTCP to the neighbor but without @@ -985,6 +985,8 @@ use 'no-tproxy' to specify that requests passed to this peer are not to have the client IP spoofed. For use to prevent packet routing issues with a cluster of peers behind WCCPv2. + +

multicast-siblings ported from 2.7 cache_store_log @@ -1564,7 +1566,6 @@

COSS maxfullbufs= option not yet ported from 2.6 cache_peer -

multicast-siblings not yet ported from 2.7

idle= not yet ported from 2.7

http11 not yet ported from 2.7

monitorinterval= not yet ported from 2.6 === modified file 'src/cache_cf.cc' --- src/cache_cf.cc 2010-01-29 13:16:35 +0000 +++ src/cache_cf.cc 2010-02-12 12:26:49 +0000 @@ -1736,6 +1736,10 @@ p->options.no_tproxy = 1; } else if (!strcasecmp(token, "multicast-responder")) { p->options.mcast_responder = 1; +#if PEER_MULTICAST_SIBLINGS + } else if (!strcasecmp(token, "multicast-siblings")) { + p->options.mcast_siblings = 1; +#endif } else if (!strncasecmp(token, "weight=", 7)) { p->weight = xatoi(token + 7); } else if (!strncasecmp(token, "basetime=", 9)) { === modified file 'src/cf.data.pre' --- src/cf.data.pre 2010-01-30 01:08:33 +0000 +++ src/cf.data.pre 2010-02-12 12:26:49 +0000 @@ -1739,6 +1739,15 @@ userhash Load-balance parents based on the client proxy_auth or ident username. sourcehash Load-balance parents based on the client source IP. + + multicast-siblings + To be used only for cache peers of type "multicast". + ALL members of this multicast group have "sibling" + relationship with it, not "parent". This is to a mulicast + group when the requested object would be fetched only from + a "parent" cache, anyway. It's useful, e.g., when + configuring a pool of redundant Squid proxies, being + members of the same multicast group. ==== PEER SELECTION OPTIONS ==== === modified file 'src/neighbors.cc' --- src/neighbors.cc 2009-12-16 00:56:45 +0000 +++ src/neighbors.cc 2010-02-12 12:26:49 +0000 @@ -124,6 +124,11 @@ if (d->type != PEER_NONE) return d->type; } +#if PEER_MULTICAST_SIBLINGS + if (p->type == PEER_MULTICAST) + if (p->options.mcast_siblings) + return PEER_SIBLING; +#endif return p->type; } @@ -143,6 +148,11 @@ assert(request != NULL); if (neighborType(p, request) == PEER_SIBLING) { +#if PEER_MULTICAST_SIBLINGS + if (p->type == PEER_MULTICAST && p->options.mcast_siblings && + (request->flags.nocache || request->flags.refresh || request->flags.loopdetect || request->flags.need_validation)) + debugs(15, 2, "peerAllowedToUse(" << p->name << ", " << request->host << ") : multicast-siblings optimization match"); +#endif if (request->flags.nocache) return 0; @@ -1570,6 +1580,11 @@ if (p->options.mcast_responder) storeAppendPrintf(sentry, " multicast-responder"); +#if PEER_MULTICAST_SIBLINGS + if (p->options.mcast_siblings) + storeAppendPrintf(sentry, " multicast-siblings"); +#endif + if (p->weight != 1) storeAppendPrintf(sentry, " weight=%d", p->weight); === modified file 'src/structs.h' --- src/structs.h 2010-01-13 12:11:48 +0000 +++ src/structs.h 2010-02-12 12:26:49 +0000 @@ -38,6 +38,8 @@ /* needed for the global config */ #include "HttpHeader.h" +#define PEER_MULTICAST_SIBLINGS 1 + struct acl_name_list { char name[ACL_NAME_SZ]; acl_name_list *next; @@ -882,6 +884,9 @@ unsigned int sourcehash:1; unsigned int originserver:1; unsigned int no_tproxy:1; +#if PEER_MULTICAST_SIBLINGS + unsigned int mcast_siblings:1; +#endif } options; int weight;