Description
Tomás Cohen Arazi (tcohen)
2016-09-06 19:23:49 UTC
Created attachment 55265 [details] [review] Bug 17261: Add memcached configuration info to about.pl This patch adds a row in the About > System information tab, showing the current configuration for memcached. To test: - Apply this patch, have memcached configured for the current instance (this is the default in kohadevbox) - Make sure you have the memcached server running: $ sudo service memcached start - Open the about page in the browser => SUCCESS: You get something like: Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running - Stop the memcached server: $ sudo service memcached stop - Reload the about page => SUCCESS: You get something like Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running - Set both MEMCACHED_* variables in the apache config for intranet the empty string: $ sudo vim /etc/apache2/sites-enabled/kohadev.conf .. SetEnv MEMCACHED_SERVERS "" #"127.0.0.1:11211" SetEnv MEMCACHED_NAMESPACE "" #"koha_kohadev" .. - Restart apache: $ sudo service apache2 restart - Reload the about page => SUCCESS: You get something like: Memcached: Servers: undefined| Namespace: undefined | Status: unknown - Sign off :-D Sponsored-by: ByWater Solutions Created attachment 55297 [details] [review] Bug 17261: Add memcached configuration info to about.pl This patch adds a row in the About > System information tab, showing the current configuration for memcached. To test: - Apply this patch, have memcached configured for the current instance (this is the default in kohadevbox) - Make sure you have the memcached server running: $ sudo service memcached start - Open the about page in the browser => SUCCESS: You get something like: Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running - Stop the memcached server: $ sudo service memcached stop - Reload the about page => SUCCESS: You get something like Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running - Set both MEMCACHED_* variables in the apache config for intranet the empty string: $ sudo vim /etc/apache2/sites-enabled/kohadev.conf .. SetEnv MEMCACHED_SERVERS "" #"127.0.0.1:11211" SetEnv MEMCACHED_NAMESPACE "" #"koha_kohadev" .. - Restart apache: $ sudo service apache2 restart - Reload the about page => SUCCESS: You get something like: Memcached: Servers: undefined| Namespace: undefined | Status: unknown - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 55309 [details] [review] Bug 17261: (followup) Rebase against 17189 and 11921 This patch adjusts the original one so it works on top of 17189 and 11921. It adds an 'Effective caching method' text which can be useful, when memcached is not available. Created attachment 55327 [details] [review] Bug 17261: The default memcached namespace is "koha" If no namespace is defined in ENV or the config, "koha" is used as the default memcached namespace (See Koha::Cache->new) Created attachment 55328 [details] [review] Bug 17261: Memcached may not longer be running If plack is started with memcached, memcached will be considered as running, even if it has been stopped (or crashed). This case should be highlighted on the about page. Note that I am not sure about the consequences of this specific case! Can I get a signoff on the 2 last patches? Created attachment 55535 [details] [review] Bug 17261: Add memcached configuration info to about.pl This patch adds a row in the About > System information tab, showing the current configuration for memcached. To test: - Apply this patch, have memcached configured for the current instance (this is the default in kohadevbox) - Make sure you have the memcached server running: $ sudo service memcached start - Open the about page in the browser => SUCCESS: You get something like: Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running - Stop the memcached server: $ sudo service memcached stop - Reload the about page => SUCCESS: You get something like Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running - Set both MEMCACHED_* variables in the apache config for intranet the empty string: $ sudo vim /etc/apache2/sites-enabled/kohadev.conf .. SetEnv MEMCACHED_SERVERS "" #"127.0.0.1:11211" SetEnv MEMCACHED_NAMESPACE "" #"koha_kohadev" .. - Restart apache: $ sudo service apache2 restart - Reload the about page => SUCCESS: You get something like: Memcached: Servers: undefined| Namespace: undefined | Status: unknown - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 55536 [details] [review] Bug 17261: (followup) Rebase against 17189 and 11921 This patch adjusts the original one so it works on top of 17189 and 11921. It adds an 'Effective caching method' text which can be useful, when memcached is not available. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 55537 [details] [review] Bug 17261: The default memcached namespace is "koha" If no namespace is defined in ENV or the config, "koha" is used as the default memcached namespace (See Koha::Cache->new) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 55538 [details] [review] Bug 17261: Memcached may not longer be running If plack is started with memcached, memcached will be considered as running, even if it has been stopped (or crashed). This case should be highlighted on the about page. Note that I am not sure about the consequences of this specific case! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 55542 [details] [review] Bug 17261: (followup) Mention the need to start memcached before plack Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (In reply to Tomás Cohen Arazi from comment #11) > Created attachment 55542 [details] [review] [review] > Bug 17261: (followup) Mention the need to start memcached before plack > > Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> I cannot explain what's happening but actually it seems that if you restart memcached without plack, the first request will display "not running", but the second one will display "running". And it seems to work correctly (i.e. the connection to memcached is restored). (In reply to Tomás Cohen Arazi from comment #11) > Created attachment 55542 [details] [review] [review] > Bug 17261: (followup) Mention the need to start memcached before plack It seems that in debian packaged versions, koha script (which brings up starman/plack and now rebuild_zebra.pl in daemon mode too) in /etc/rc* is started before memcached and before mysql.. On top of Bug 11921, there is a possibility that for a given process or plack worker, "Effective caching method" may be in fact sometimes mixed / various (e.g. memcached used for syspref caching and Cache::Memory for everything else, or vice versa). Jacek, do you think 17261 and 17274 are correct or do they need to be reworked? I think we are cover all the cases and that should work correctly most of the time. However it will be bad to display wrong informations... Not sure about the last comment - is this ready for QA? (In reply to Katrin Fischer from comment #16) > Not sure about the last comment - is this ready for QA? I think is ready for QA. The problem is that it is possible to construct a scenario in which each Plack worker has a different memcached situation. It will only mean something is not really ok, and make people look at it. Otherwise, users will have the memcached information which is also handy. (In reply to Tomás Cohen Arazi from comment #17) > (In reply to Katrin Fischer from comment #16) > > Not sure about the last comment - is this ready for QA? > > I think is ready for QA. The problem is that it is possible to construct a > scenario in which each Plack worker has a different memcached situation. Or the scenario when the single plack worker has one of eight different hypothetically possible memcached & Cache::Memory combinations / situations ;) (In reply to Tomás Cohen Arazi from comment #17) > I think is ready for QA. +1 IMO this patchset is fine as it is, and would be a valuable addition even if it doesn't fully cover some very unusual (and almost purely theoretical) situations. (In reply to Jonathan Druart from comment #15) > I think we are cover all the cases and that should work correctly most of > the time. +1, if we want to minimize the possibilities of mixed/inconsistent cache initializations, it would be better to do it differently / in different places, eg.: - improve memcache initialization procedures (currently each one of 3 cache instances has it's own connection to the memcache server = 3 separate inits when plack worker gets created, each init can have different result) - at some time, maybe get rid of Cache::Memory entirely? - sooner or later working memcached setup should IMO became a hard requirement (especially under plack) This works for me nicely, until I activate Plack. Testing in a kohadevbox, started testing without Plack, test plan worked. Then I started Plack: sudo koha-plack --enable kohadev sudo service apache2 restart sudo koha-plack --start kohadev About page: Servers: undefined| Namespace: koha | Status: unknown | Effective caching method: Cache::Memory I tried restarting memcached: sudo service memcached restart No change - is this to be expected? Everything looks ok for me. Without memcached and plack configured/set: Servers: undefined| Namespace: koha | Status: unknown | Effective caching method: Cache::Memory % Edit $KOHA_CONF and add memcached_servers % sudo service memcached start Servers: localhost:11211 | Namespace: koha | Status: running. % sudo koha-plack --enable kohadev % sudo koha-plack --start kohadev % sudo service apache2 restart Servers: localhost:11211 | Namespace: koha | Status: running. % sudo service memcached stop Servers: localhost:11211 | Namespace: koha | Status: not running. Remember memcached needs to be started before Plack. % sudo service memcached start Servers: localhost:11211 | Namespace: koha | Status: not running. Remember memcached needs to be started before Plack. % sudo koha-plack --restart kohadev Servers: localhost:11211 | Namespace: koha | Status: running. Created attachment 57049 [details] [review] [PASSED QA] Bug 17261: Add memcached configuration info to about.pl This patch adds a row in the About > System information tab, showing the current configuration for memcached. To test: - Apply this patch, have memcached configured for the current instance (this is the default in kohadevbox) - Make sure you have the memcached server running: $ sudo service memcached start - Open the about page in the browser => SUCCESS: You get something like: Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: running - Stop the memcached server: $ sudo service memcached stop - Reload the about page => SUCCESS: You get something like Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_kohadev | Status: not running - Set both MEMCACHED_* variables in the apache config for intranet the empty string: $ sudo vim /etc/apache2/sites-enabled/kohadev.conf .. SetEnv MEMCACHED_SERVERS "" #"127.0.0.1:11211" SetEnv MEMCACHED_NAMESPACE "" #"koha_kohadev" .. - Restart apache: $ sudo service apache2 restart - Reload the about page => SUCCESS: You get something like: Memcached: Servers: undefined| Namespace: undefined | Status: unknown - Sign off :-D Sponsored-by: ByWater Solutions Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 57050 [details] [review] [PASSED QA] Bug 17261: (followup) Rebase against 17189 and 11921 This patch adjusts the original one so it works on top of 17189 and 11921. It adds an 'Effective caching method' text which can be useful, when memcached is not available. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 57051 [details] [review] [PASSED QA] Bug 17261: The default memcached namespace is "koha" If no namespace is defined in ENV or the config, "koha" is used as the default memcached namespace (See Koha::Cache->new) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 57052 [details] [review] [PASSED QA] Bug 17261: Memcached may not longer be running If plack is started with memcached, memcached will be considered as running, even if it has been stopped (or crashed). This case should be highlighted on the about page. Note that I am not sure about the consequences of this specific case! Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Created attachment 57053 [details] [review] [PASSED QA] Bug 17261: (followup) Mention the need to start memcached before plack Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Pushed to master for 16.11, thanks Tomas, Jonathan! enhancement, passing for 16.05 |