Dead host detection and remapping keys to other memcached servers

Brad Fitzpatrick brad@danga.com
Mon, 24 Nov 2003 15:28:19 -0800 (PST)


Ah, yes... that's probably it.  Didn't even think of that.


On Mon, 24 Nov 2003, Toast Oven wrote:

> From when I was porting the perl code over to java... the client marks a
> whole host as dead if it can't connect on one port, so it might not
> connect at all to the server on port 2048, since it appears the host is
> dead. I haven't been very attentive to the changes as of late though, so I
> might have missed this coming out.
>
> Try specifiying one of the servers as 127.0.0.2 instead of 127.0.0.1 and
> see if that gets rid of the snafus.
>
> toast
>
>
>
> On Mon, 24 Nov 2003, Brad Fitzpatrick wrote:
>
> > Well, the item won't exist in port 2048's cache the first time at least...
> > so you'll get at least one snafu with your code.  The second time it
> > should work.
> >
> > (but the remapping code in the client isn't perfect... sometimes it gives
> > up after so many rehashings.  most the time it works, though...)
> >
> >
> > On Mon, 24 Nov 2003, Yusuf Goolamabbas wrote:
> >
> > > Hi, Just came across memcached and am playing with it
> > > On a RH 9 box using libevent 0.7c (which uses poll) and memcached-1.1.9 with
> > > Cache::MemCached 1.11 and the following test program
> > >
> > > use Cache::Memcached;
> > > $memd = new Cache::Memcached {
> > >            'servers' => [ "127.0.0.1:2049" , "127.0.0.1:2048" ] ,
> > >            'debug' => 1,
> > >            'compress_threshhold' => 10000
> > >          };
> > > my $obj = $memd->get("foo");
> > > if ($obj) {
> > >   print "$obj \n" ;
> > > } else {
> > >   $memd->set("foo", "bar");
> > >   print "snafu\n" ;
> > > }
> > >
> > > The key is initally mapped to the server listening on port 2049, I
> > > expected that if I shut down 2049, then the Perl API would then add the
> > > key again on the server listening on port 2048 and subsequently the
> > > results would be read from memcache. However, this does not seem to be
> > > the case and until the 2049 server is started again, "snafu" keeps on
> > > getting printed
> > >
> > > Have I missed something obvious ?
> > >
> > > Regards, Yusuf
> > > --
> > > If you're not using Firebird, you're not surfing the web
> > >    you're suffering it
> > > http://www.mozilla.org/products/firebird/why/
> > >
> > >
> >
>
>