[Bug 18232] New: Koha::Cache::flush - Simply flush all caches
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Bug ID: 18232 Summary: Koha::Cache::flush - Simply flush all caches Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org This is handy when upgrading Koha or fiddling with config. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 60922 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=60922&action=edit Bug 18232 - Koha::Cache::flush - Simply flush all caches So we can easily and without reading the code, figure out how to flush all caches. perl -e 'use Koha::Caches; Koha::Caches::flush();' This is handy dandy when upgrading Koha or fiddling with configs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- This might work or might not :) flush is needed however. I'll keep posting followups if this doesn't. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |16140 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16140 [Bug 16140] Only clear L1 cache when needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |olli-antti.kivilahti@jns.fi CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Assigning to Olli-Antti as he provided the patch. Patch still applies, but I am not sure how to verify if it works correctly. Running the command from koha-shell gives no feedback, but no error either. Leaving for another tester. Something similar might already exist wrapped in commands like 'restart_all' on kohadevbox? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 --- Comment #4 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 68468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68468&action=edit Bug 18232 - Koha::Cache::flush - Simply flush all caches - Squashable1, fix pesky syspref cache issue After flushing Koha::Caches this flush() also removed the references to the singleton caches, forcing reinstating the cache connection. C4::Context had a hard-coded package variable referencing to the sysprefs cache. After flushing for the first time, the reference to the syspref cache was severed for Koha::Caches, but not to the C4::Context syspref cache, and flushing started to fail because the syspref cache was no longer referenced from Koha::Caches. The original change was made to try to get around the memcached cache expiration issues. And had this unintended side-effect. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |19523 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19523 [Bug 19523] Koha::Cache changes not passed to all plack workers with in-memory caching. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |J.P.Knight@lboro.ac.uk --- Comment #5 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Applied to master on my test kohadevbox cleanly and: perl -e 'use Koha::Caches; Koha::Caches::flush();' seems to run without any errors. As with Katrin, I could do with a test plan to check its working. I've tried poking around in memcached (using `memcached -vv` and `telnet localhost 11211` and then issuing stats commands), but I can't see much difference on a dev box to be honest. I'm guessing it needs a load of traffic sent to it to make the memcached caches fill up so that a flush is noticeable? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Jon Knight from comment #5)
Applied to master on my test kohadevbox cleanly and:
perl -e 'use Koha::Caches; Koha::Caches::flush();'
seems to run without any errors.
As with Katrin, I could do with a test plan to check its working. I've tried poking around in memcached (using `memcached -vv` and `telnet localhost 11211` and then issuing stats commands), but I can't see much difference on a dev box to be honest. I'm guessing it needs a load of traffic sent to it to make the memcached caches fill up so that a flush is noticeable?
You could try the following for a more detailed view of what's in the cache if you have the right tools installed: memdump --server localhost:11211 (might be memcdump on Debian) memcat --server localhost:11211 KOHADEV:syspref:syspref_opacnavright (might be memccat) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |BLOCKED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18232 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #7 from Magnus Enger <magnus@libriotech.no> --- Do we still need this after Bug 20116, which added misc/bin/clear_cache.pl? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org