Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of docs for default memcached connection loss behaviour #11

Open
m6w6 opened this issue Jan 20, 2020 · 2 comments
Open

Lack of docs for default memcached connection loss behaviour #11

m6w6 opened this issue Jan 20, 2020 · 2 comments

Comments

@m6w6
Copy link
Collaborator

m6w6 commented Jan 20, 2020

Imported from Launchpad using lp2gh.


I can't seem to find documentation that describes exactly what happens when a server goes down, and how best to handle its graceful recovery.

The documentation for the behaviours seems to assume a certain level of knowledge that I don't have, or at least I'm not sure about. It's a reference manual. I'm looking for a guide.

My question is similar to http://stackoverflow.com/questions/10029432/libmemcached-fail-over-of-a-clusters-node
except that a) I'd like more background information, and b) there's no discussion of handling the recovery of a node.


As an example, the venerable and original Cache::Memcached module (https://metacpan.org/source/DORMANDO/Cache-Memcached-1.30/lib/Cache/Memcached.pm) seems to recalculate the 'buck2sock' mapping (by $socket_cache_generation++;) whenever a socket is marked dead by _dead_sock() being called.

But some of calls to _dead_sock, specifically those from connection setup, also provide a duration ($dead_for) during which the host should be regarded as dead.

So a single communications error on an established socket doesn't remove a server, but does cause a connection drop and reconnect. If that reconnect fails then the server is removed from the buck2sock calculation for a period.

This seems reasonable and is self-repairing. Sadly the libmemcached docs don't seem to discuss this behaviour at all.


I'm rather surprised I can't find this kind of discussion in the libmemcached docs. Am I missing something?

The use-case is simply what I imagine a typical installation would be: a list of memcached servers and consistent hashing enabled.

I was asked that question recently and realised that I wasn't sure and was then doubly surprised by not being able to find it documented.

I'm looking for a simple description of exactly what happens by default in libmemcached when a memcached server goes down (both for a clean tcp close and for a network outage leading to tcp timeouts) and when it comes back again later.

That would provide the background detail against which the various optional behaviours could be explained and understood.

@m6w6 m6w6 added the New label Jan 20, 2020
@m6w6
Copy link
Collaborator Author

m6w6 commented Jan 20, 2020


Thanks, tracking this via bug reports is the best way to make this happen.

Sent from my Ti85

On Feb 25, 2013, at 2:35, TimBunce wrote:

Public bug reported:

I can't seem to find documentation that describes exactly what happens
when a server goes down, and how best to handle its graceful recovery.

The documentation for the behaviours seems to assume a certain level of
knowledge that I don't have, or at least I'm not sure about. It's a
reference manual. I'm looking for a guide.

My question is similar to http://stackoverflow.com/questions/10029432/libmemcached-fail-over-of-a-clusters-node
except that a) I'd like more background information, and b) there's no discussion of handling the recovery of a node.


As an example, the venerable and original Cache::Memcached module
(https://metacpan.org/source/DORMANDO/Cache-
Memcached-1.30/lib/Cache/Memcached.pm) seems to recalculate the
'buck2sock' mapping (by $socket_cache_generation++;) whenever a socket
is marked dead by _dead_sock() being called.

But some of calls to _dead_sock, specifically those from connection
setup, also provide a duration ($dead_for) during which the host should
be regarded as dead.

So a single communications error on an established socket doesn't remove
a server, but does cause a connection drop and reconnect. If that
reconnect fails then the server is removed from the buck2sock
calculation for a period.

This seems reasonable and is self-repairing. Sadly the libmemcached docs
don't seem to discuss this behaviour at all.


I'm rather surprised I can't find this kind of discussion in the
libmemcached docs. Am I missing something?

The use-case is simply what I imagine a typical installation would be: a
list of memcached servers and consistent hashing enabled.

I was asked that question recently and realised that I wasn't sure and
was then doubly surprised by not being able to find it documented.

I'm looking for a simple description of exactly what happens by default
in libmemcached when a memcached server goes down (both for a clean tcp
close and for a network outage leading to tcp timeouts) and when it
comes back again later.

That would provide the background detail against which the various
optional behaviours could be explained and understood.

** Affects: libmemcached
Importance: Undecided
Status: New

--
You received this bug notification because you are subscribed to
libmemcached.
https://bugs.launchpad.net/bugs/1132725

Title:
Lack of docs for default memcached connection loss behaviour

Status in libmemcached - A C and C++ client library for memcached:
New

Bug description:
I can't seem to find documentation that describes exactly what happens
when a server goes down, and how best to handle its graceful recovery.

The documentation for the behaviours seems to assume a certain level
of knowledge that I don't have, or at least I'm not sure about. It's a
reference manual. I'm looking for a guide.

My question is similar to http://stackoverflow.com/questions/10029432/libmemcached-fail-over-of-a-clusters-node
except that a) I'd like more background information, and b) there's no discussion of handling the recovery of a node.


As an example, the venerable and original Cache::Memcached module
(https://metacpan.org/source/DORMANDO/Cache-
Memcached-1.30/lib/Cache/Memcached.pm) seems to recalculate the
'buck2sock' mapping (by $socket_cache_generation++;) whenever a socket
is marked dead by _dead_sock() being called.

But some of calls to _dead_sock, specifically those from connection
setup, also provide a duration ($dead_for) during which the host
should be regarded as dead.

So a single communications error on an established socket doesn't
remove a server, but does cause a connection drop and reconnect. If
that reconnect fails then the server is removed from the buck2sock
calculation for a period.

This seems reasonable and is self-repairing. Sadly the libmemcached
docs don't seem to discuss this behaviour at all.


I'm rather surprised I can't find this kind of discussion in the
libmemcached docs. Am I missing something?

The use-case is simply what I imagine a typical installation would be:
a list of memcached servers and consistent hashing enabled.

I was asked that question recently and realised that I wasn't sure and
was then doubly surprised by not being able to find it documented.

I'm looking for a simple description of exactly what happens by
default in libmemcached when a memcached server goes down (both for a
clean tcp close and for a network outage leading to tcp timeouts) and
when it comes back again later.

That would provide the background detail against which the various
optional behaviours could be explained and understood.

To manage notifications about this bug go to:
https://bugs.launchpad.net/libmemcached/+bug/1132725/+subscriptions

@m6w6
Copy link
Collaborator Author

m6w6 commented Jan 20, 2020


Any news on this? It's been over a year now. It seems like a simple, and important, request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant