Better documentation on what happens when memcached instance fails.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
All software is self-builded: PHP 5.3.10 + memcached extension 2.1.0, linked with libmemcached 1.0.14.
Running simple PHP-script:
<?php
$m = new Memcached();
$m->setOption(
$m->setOption(
$m->setOption(
// ketama options
$m->setOption(
$m->setOption(
$m->setOption(
$m->setOption(
$servers = array();
$servers[] = array('127.0.0.1', 11211, 100);
$servers[] = array('
$m->addServers(
for ( $i=0; $i<100; $i++ ) {
sleep(1);
if ($m->getResultC
if ($m->getResultC
}
}
}
?>
After several successful cycles, dropping down second server (192.168.0.1).
Expected behavior:
1. After dropping connection and polling timeout, server will be marked as FAULTY.
2. After first connecting attempt, server will be marked as DEAD. Memcached ext./libmemcached will redistribute key to first memcached server (127.0.0.1).
Observed behavior:
1. After dropping connection and polling timeout, server is marked as FAULTY? (It's an assumption, cannot check).
2. Memcached ext./libmemcached open connection to first server (127.0.0.1), SUCCESSFULLY stores the key AND getResultMessage returns "SERVER IS MARKED DEAD". (It's normal)
3. At the next cycle, Memcached ext./libmemcached successfully stores the key. (It's normal, too)
4. At the next and further cycles, Memcached ext./libmemcached return FALSE on set() operation and getResultMessage returns "SERVER IS MARKED DEAD".
It's hard confusing. Why just not using first server further?
I check memcached extension's sources and believe it pass ketama options to libmemcached well.
So I propose that unexpected behavior is a bug. Or maybe I used invalid option set with memcached extension/
description: | updated |
Are you using weighting?
On Sun, Mar 24, 2013 at 7:27 PM, Denis Shashkov <email address hidden> wrote:
> ** Description changed: Memcached: :OPT_COMPRESSIO N, false); Memcached: :OPT_CONNECT_ TIMEOUT, 10); Memcached: :OPT_RETRY_ TIMEOUT, 1); Memcached: :OPT_DISTRIBUTI ON, :DISTRIBUTION_ CONSISTENT) ; Memcached: :OPT_LIBKETAMA_ COMPATIBLE, true); Memcached: :OPT_SERVER_ FAILURE_ LIMIT, 1); Memcached: :OPT_REMOVE_ FAILED_ SERVERS, true); 192.168. 0.1', 11212, 100); $servers) ; $m->set( 'key', 1)); ode() > 0) { ode() !== Memcached: :RES_NOTFOUND ) { ssage() .PHP_EOL; $m->set( 'key', 1)); ode() > 0) { ode() !== Memcached: :RES_NOTFOUND ) { ssage() .PHP_EOL; libmemcached? libmemcached?
>
> All software is self-builded: PHP 5.3.10 + memcached extension 2.1.0,
> linked with libmemcached 1.0.14.
> Running simple PHP-script:
> <?php
> $m = new Memcached();
> $m->setOption(
> $m->setOption(
> $m->setOption(
> // ketama options
> $m->setOption(
> Memcached:
> $m->setOption(
> $m->setOption(
> $m->setOption(
>
> $servers = array();
> $servers[] = array('127.0.0.1', 11211, 100);
> $servers[] = array('
> $m->addServers(
>
> for ( $i=0; $i<100; $i++ ) {
> - sleep(1);
> - var_dump(
> - if ($m->getResultC
> - if ($m->getResultC
> - echo $m->getResultMe
> - }
> - }
> + sleep(1);
> + var_dump(
> + if ($m->getResultC
> + if ($m->getResultC
> + echo $m->getResultMe
> + }
> + }
> }
> ?>
>
> - After several successful cycles, dropping down second server
> (192.168.0.1).
> + After several successful cycles, dropping down second server
> (192.168.0.1).
> Expected behavior:
> 1. After dropping connection and polling timeout, server will be marked
> as FAULTY.
> 2. After first connecting attempt, server will be marked as DEAD.
> Memcached ext./libmemcached will redistribute key to first memcached server
> (127.0.0.1).
>
> Observed behavior:
> 1. After dropping connection and polling timeout, server is marked as
> FAULTY? (It's an assumption, cannot check).
> 2. Memcached ext./libmemcached open connection to first server
> (127.0.0.1), SUCCESSFULLY stores the key AND getResultMessage returns
> "SERVER IS MARKED DEAD". (It's normal)
> 3. At the next cycle, Memcached ext./libmemcached successfully stores
> the key. (It's normal, too)
> - 4. At the next and further cycles, Memcached ext./libmemcached return
> FALSE on set() operation and getResultMessage returns "SERVER IS MARKED
> DEAD".
> + 4. At the next and further cycles, Memcached ext./libmemcached return
> FALSE on set() operation and getResultMessage returns "SERVER IS MARKED
> DEAD".
>
> - It's hard confusing. Why just using first server further?
> + It's hard confusing. Why just not using first server further?
>
> I check memcached extension's sources and believe it pass ketama options
> to libmemcached well.
> - So I propose that unexpected behavior is a bug. Or maybe I use invalid
> option set with memcached extension/
> + So I propose that unexpected behavior is a bug. Or maybe I used invalid
> option set with memcached extension/
...