On Mon, 2007-10-29 at 15:08 +0900, Simon Horman wrote:
> [CCed lvs-devel, just so this is archived somewhere
> CCed Wensong and Julian, the other LVS maintainers]
>
>
> On Sun, Oct 28, 2007 at 10:37:08PM +0200, Rumen Bogdanovski wrote:
> > Hi all
> > I have been looking through the IPVS code, because I wanted to implement
> > more persistant connection-destination binding. I mean to try to bind
> > the unbound connection every time its status is received. This is in
> > case the destination is created later on.
> > So I found something just beneath the place I have changed to bind the
> > received connections to the services. Line ~330 of ip_vs_sync.c reads:
> >
> > } else if (!cp->dest) {
> > /* it is an entry created by the synchronization */
> > cp->state = ntohs(s->state);
> > cp->flags = flags | IP_VS_CONN_F_HASHED;
> > } /* Note that we don't touch its state and flags
> > if it is a normal entry. */
> >
> > So with my patch the bound connections will not be considered as created
> > by the synchronization. But this does not seem to be a problem.
> > I wonder if this is removed and set state and flags for all received
> > connections. As far as I understand this will not be a problem because
> > the connections will be updated only if the current director is working
> > as a backup, It will not handle any connection so it will not send any
> > to the other directors. Is there a scenario to have two master directors
> > for the same service? I think no, am I right? If I am, there should not
> > be any difference where the connection is created, right?
> > Is this code remnant from the past? What is the reason for it?
> >
> > How ever if there is a problem removing this test, I can introduce a
> > flag in "struct ip_vs_conn" and make it true for the received
> > connection and false for the local. In this case the code above should
> > read something like:
> >
> > } else if (cp->foreign) {
> > /* it is an entry created by the synchronization */
> > cp->state = ntohs(s->state);
> > cp->flags = flags | IP_VS_CONN_F_HASHED;
> > } /* Note that we don't touch its state and flags
> > if it is a normal entry. */
> >
> > And the old behavior will be restored.
> >
> > Any comments on that?
>
> I think that the check is required.
Yes it is. I have figured it out myself. And it should stay just as it
is. It is relevant to the received connections which have no service to
bind to. Not to all received connections.
|