-
Notifications
You must be signed in to change notification settings - Fork 323
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
Different consistent distribution between v2.2.0 and v3.0.3 (MEMCACHED_BEHAVIOR_KETAMA vs MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED) #344
Comments
It also seems the |
Any update on that? |
I haven't looked into this yet. The changes you describe were almost certainly on-purpose, and the new settings might be "better" but at the expense of backwards compatibility. If there are some settings you want to see exposed to |
I'm not expert in the Ketama algorithm but from what I understand the So I'd really like to be sure this change has been made on purpose and is not the result of a bad copy/paste. If it's really on purpose, could we have a short explanation about this change? Both the |
…eighted) (#392) Provides a new INI option to select the same consistent hash behavior as older versions of php-memcached, to aid in migration from PHP 5.x to PHP 7.x. When `memcached_sess_consistent_hash_type` is set to `ketama` or `ketama_weighted`, that sets either MEMCACHED_BEHAVIOR_KETAMA or MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED, respectively. Resolves #344
…eighted) (#392) Provides a new INI option to select the same consistent hash behavior as older versions of php-memcached, to aid in migration from PHP 5.x to PHP 7.x. When `memcached_sess_consistent_hash_type` is set to `ketama` or `ketama_weighted`, that sets either MEMCACHED_BEHAVIOR_KETAMA or MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED, respectively. Resolves #344
I'm not sure what's up with the |
Can someone explain if it's necessary to provide the old |
To be sure we are speaking about the same things, see https://github.com/trondn/libmemcached/blob/master/docs/memcached_behavior.pod
So basically, I have 4 webservers using a pool of 2 memcache servers to store session.
I'm trying to upgrade to php7, so my current setup is like that:
Everytimes I try to enable web1, I'm loosing all my sessions. I've checked all the configuration options and everything seems to be ok. With a basic php script I can store and load the session from any webservers, but randomly the session created with one php version is not available from the other php version. Based on these tests, I'm pretty sure the culprit is the consistent distribution which seems different between 2.2.0 and 3.0.3.
From what I can see in the code, a change has been introduced in dc5b22a#diff-25c5e7d3aa23f27466a7f0bbc2c251ec
Previously the session engine was enabling
MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED
when sess_consistent_hash_enabled was in use:After that, the default behaviour has been switched to
MEMCACHED_BEHAVIOR_KETAMA
:I just wanted to know if this change has been done on purpose or if it's a mistake as I cannot see anything related to that in the changelog.
Is it possible to restore the initial behaviour so php5.6 and php7 can coexists in the same infra and use the same memcache pool?
Thanking you in advance.
The text was updated successfully, but these errors were encountered: