Re: peer selection process

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 21 Mar 2003 08:59:04 +0100

atit_ldce wrote:
>
> I have confusion regarind peer selecion process which are as follow?
>
> 1)
>
> What following fragment of code in peerCheckNetdbDirect() indicates?
> p = whichPeer(&psstate->closest_parent_miss);
> if (p == NULL)
> return 0;
> p is not used beyond it in function..

No, but if one is not found 0 is returned.

Logic: If we do not yet know which peer is closest to the requested
object then we cannot tell if we are closer than the peer, and 0 is
returned to indicate that we do not know that we should go direct for
this request.

> 2) I got MISS from parent having closest rtt to origin server
> so hier_code = CLOSEST_PARENT_MISS in peerGetNeighborReplies()...
>
> so we have got some dest for request R.
>
> and My status for ps_state->direct = DIRECT_NO
>
> so when flow comes back to peerSelectFoo()
> in switch stmt it will go with DIRECT_NO case,
> where it call getSomeParent() and getAllparent()...

Before it gets there, it calls peerGetSomeNeighborReplies as ping_status
== PING_WAITING

> doesn't call for getSomeParent() and getAllparent() seems
> to unnecessary,since we already got destination for our Request

No, these are still not unnecessary. See previous reply on why these are
used in the DIRECT_NO case (never_direct allow ...). To freshen your
memory: If never_direct allow (DIRECT_NO) is in effect, then Squid MUST
forward the request to a parent, even if the first selected parent
fails. Receiving an ICP reply from a peer is not a guarantee that the
peer will be able to process the request.

Regards
Henrik
Received on Fri Mar 21 2003 - 01:05:26 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:34 MST