[Bug 42077] New: Move RabbitMQ from mandatory to optional and make SQL polling the default
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Bug ID: 42077 Summary: Move RabbitMQ from mandatory to optional and make SQL polling the default Initiative type: --- Sponsorship --- status: Product: Koha Version: 24.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: katrin.fischer@bsz-bw.de QA Contact: testopia@bugs.koha-community.org Depends on: 41506 On bug 41506 we discussed the option of removing RabbitMQ from the codebase. There appears to be consensus that a sensible first step is to update packages to make RabbitMQ optional and SQL polling the default. I believe this would still allow libraries to use RabbitMQ and even move it to a separate server without it installing on the Koha server. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41506 [Bug 41506] Should we remove RabbitMQ? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |mark@hofstetter.at |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Mark Hofstetter <mark@hofstetter.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #1 from Mark Hofstetter <mark@hofstetter.at> --- Created attachment 195839 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=195839&action=edit Bug 42077: Make polling the default jobs notification method and RabbitMQ optional Change the default value of JobsNotificationMethod from STOMP to polling for new installations and for the migration that inserts the preference. Adjust Debian package metadata so rabbitmq-server is no longer a hard dependency and is instead installed as an optional recommended package. This keeps RabbitMQ available for sites that want STOMP notifications, while making polling the default and avoiding a mandatory RabbitMQ installation. To test: 1. Confirm JobsNotificationMethod defaults to "polling" in sysprefs.sql. 2. Confirm the DB revision inserts JobsNotificationMethod with value "polling". 3. Confirm rabbitmq-server is no longer listed in Depends in debian/ control.in. 4. Confirm rabbitmq-server is listed as Recommends in debian/control.in. 5. Confirm the generated debian/control reflects the same dependency changes. 6. build koha debian packages, install them and check if "polling" is set JobsNotificationMethod and rabbitmq-server is not installed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |johanna.raisa@koha-suomi.fi --- Comment #2 from Johanna Räisä <johanna.raisa@koha-suomi.fi> --- The patch doesn't apply anymore, please fix the issue. Applying: Bug 42077: Make polling the default jobs notification method and RabbitMQ optional Using index info to reconstruct a base tree... M installer/data/mysql/mandatory/sysprefs.sql Falling back to patching base and 3-way merge... Auto-merging installer/data/mysql/mandatory/sysprefs.sql CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql error: Failed to merge in the changes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Johanna Räisä <johanna.raisa@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com Version|24.11 |Main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #195839|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 207310 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207310&action=edit Bug 42077: Make polling the default jobs notification method and RabbitMQ optional Change the default value of JobsNotificationMethod from STOMP to polling for new installations and for the migration that inserts the preference. Adjust Debian package metadata so rabbitmq-server is no longer a hard dependency and is instead installed as an optional recommended package. This keeps RabbitMQ available for sites that want STOMP notifications, while making polling the default and avoiding a mandatory RabbitMQ installation. To test: 1. Confirm JobsNotificationMethod defaults to "polling" in sysprefs.sql. 2. Confirm the DB revision inserts JobsNotificationMethod with value "polling". 3. Confirm rabbitmq-server is no longer listed in Depends in debian/ control.in. 4. Confirm rabbitmq-server is listed as Recommends in debian/control.in. 5. Confirm the generated debian/control reflects the same dependency changes. 6. build koha debian packages, install them and check if "polling" is set JobsNotificationMethod and rabbitmq-server is not installed Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207310|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 207311 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207311&action=edit Bug 42077: Make polling the default jobs notification method and RabbitMQ optional Change the default value of JobsNotificationMethod from STOMP to polling for new installations and for the migration that inserts the preference. Adjust Debian package metadata so rabbitmq-server is no longer a hard dependency and is instead installed as an optional recommended package. This keeps RabbitMQ available for sites that want STOMP notifications, while making polling the default and avoiding a mandatory RabbitMQ installation. To test: 1. Confirm JobsNotificationMethod defaults to "polling" in sysprefs.sql. 2. Confirm the DB revision inserts JobsNotificationMethod with value "polling". 3. Confirm rabbitmq-server is no longer listed in Depends in debian/ control.in. 4. Confirm rabbitmq-server is listed as Recommends in debian/control.in. 5. Confirm the generated debian/control reflects the same dependency changes. 6. build koha debian packages, install them and check if "polling" is set JobsNotificationMethod and rabbitmq-server is not installed Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Edit: I made the `rabbitmq-server` package listed on `Suggests` instead, so it is not pulled unless explicit. I also removed the edit on the original dbrev that introduced the syspred as that's not how we do it. Loving this patch :-D (tcohen) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|tomascohen@gmail.com |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|41506 | Blocks| |41506 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41506 [Bug 41506] Should we remove RabbitMQ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I reversed the dependencies, as it might be too late on the release cycle to remove RabbitMQ, but we can make it not the default anymore for fresh installs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207311|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #6 from Mason James <mtj@kohaaloha.com> --- Created attachment 207312 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207312&action=edit Bug 42077: Make polling the default jobs notification method and RabbitMQ optional Change the default value of JobsNotificationMethod from STOMP to polling for new installations and for the migration that inserts the preference. Adjust Debian package metadata so rabbitmq-server is no longer a hard dependency and is instead installed as an optional recommended package. This keeps RabbitMQ available for sites that want STOMP notifications, while making polling the default and avoiding a mandatory RabbitMQ installation. To test: 1. Confirm JobsNotificationMethod defaults to "polling" in sysprefs.sql. 2. Confirm the DB revision inserts JobsNotificationMethod with value "polling". 3. Confirm rabbitmq-server is no longer listed in Depends in debian/ control.in. 4. Confirm rabbitmq-server is listed as Recommends in debian/control.in. 5. Confirm the generated debian/control reflects the same dependency changes. 6. build koha debian packages, install them and check if "polling" is set JobsNotificationMethod and rabbitmq-server is not installed Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Edit: I made the `rabbitmq-server` package listed on `Suggests` instead, so it is not pulled unless explicit. I also removed the edit on the original dbrev that introduced the syspred as that's not how we do it. Loving this patch :-D (tcohen) Signed-off-by: mason james <mtj@kohaaloha.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43729 Status|Signed Off |Passed QA Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43729 [Bug 43729] Remove STOMP/RabbitMQ background jobs support -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am happy to see this change as it will make our live a bit easier. What are the consequences for libraries already using RabbitMQ? Do we need to make sure that they are notified somehow? Adding the release-notes-needed as a first step. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #8 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- @mason I think we are missing the postinst upgrade. It will always try to start rabbitmq on each upgrade, which should only happen if you are using STOMP. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |pedro.amorim@openfifth.co.u | |k --- Comment #9 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi Mark and Mason, some things here need addressing before we push: 1) admin.pref still advertises STOMP as the default for JobsNotificationMethod: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref, in the JobsNotificationMethod entry: - default: STOMP - "STOMP (default) requires RabbitMQ running." Both need updating to reflect polling as the new default. 2) The code fallbacks still assume the old default when the preference has no value: - misc/workers/background_jobs_worker.pl, where $notification_method is set - Koha/BackgroundJob.pm, in the connect method Both use C4::Context->preference('JobsNotificationMethod') // 'STOMP', which should now fall back to 'polling'. 3) Tomás' comment 8 is still open. This should either be addressed here or moved to a follow-up bug. 4) Katrin's questions in comment 7 are still unanswered. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think it would be great to have this in 26.11 - would it be possible to make this a release candidate? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_26_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #11 from Mark Hofstetter <mark@hofstetter.at> --- working on it -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #12 from Mark Hofstetter <mark@hofstetter.at> --- Created attachment 210873 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210873&action=edit Bug 42077: (follow-up) Align polling defaults and optional broker upgrades Complete the polling default in the administration preference and both runtime fallbacks. Existing explicit STOMP settings and the historical database revision remain unchanged. Only enable the STOMP plugin and restart a local RabbitMQ service when an instance explicitly uses STOMP with a local broker. Enable the plugin offline so a stopped broker does not break package configuration. Polling instances, remote brokers and installations without instances do not trigger local RabbitMQ service operations. Report unavailable instance databases without failing package configuration. Add Debian NEWS and installation guidance explaining existing settings, worker restarts and the apt-mark manual command for retaining an automatically installed broker. Fix the trailing dependency comma and keep control and control.in consistent. Add service-behaviour regressions and cover missing and empty preference values. Mock the transport-specific unit tests so they no longer require a running broker when RabbitMQ is optional. Test plan: 1. Apply attachment 207312 and this follow-up on an isolated test system. 2. On a fresh installation confirm JobsNotificationMethod is polling. Search for the preference in administration: polling is selected and the explanation identifies it as the default. STOMP remains available. 3. Build the Debian packages. Confirm rabbitmq-server is only in Suggests for koha-common and koha-deps, and control matches control.in. 4. Install koha-core, koha-sysv (or koha-systemd) and koha-common. Confirm koha-common configures successfully without rabbitmq-server installed and a default apt reinstall does not pull it in. 5. Stop RabbitMQ on the isolated system. Enqueue a batch item update and confirm the worker finishes it and applies the requested item notes. 6. Temporarily rename the JobsNotificationMethod preference row, clear the syspref cache and start a worker. Repeat the job check: it must finish without attempting a broker connection. Restore the row and clear the cache afterward. 7. With polling selected, run koha-common's postinst configure action: the stopped RabbitMQ service must remain stopped. 8. Select STOMP and configure a remote broker hostname. Repeat the configure action: the local RabbitMQ service must remain stopped. 9. Configure localhost for STOMP with RabbitMQ installed but stopped. The configure action must enable STOMP offline and start the broker. Confirm the STOMP preference remains unchanged and an enqueued job completes through STOMP. 10. Read NEWS.Debian and README.Debian. They must explain that existing settings are preserved, workers remain required, and a local broker that is still needed can be protected using apt-mark manual. 11. Run with RabbitMQ stopped: prove xt/koha-common-postinst.t \ t/db_dependent/Koha/BackgroundJob.t \ t/db_dependent/Koha/BackgroundJobs.t \ t/db_dependent/Koha/BackgroundJob/BatchUpdateItem.t \ t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblio.t \ t/db_dependent/Koha/BackgroundJob/MARCImportCommitBatch.t \ t/db_dependent/Koha/BackgroundJob/StageMARCForImport.t The packaging test includes mixed instances, missing/empty values, loopback addresses, local hostnames and an unavailable database. 12. Restore polling and restart both worker queues for further tests. Co-authored-by: OpenAI Codex <codex@openai.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #13 from Mark Hofstetter <mark@hofstetter.at> --- what would be the correct Status? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- To raise attention, sending it back to RM to decide on status. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 --- Comment #15 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42077 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |New installations now use release notes| |polling, rather than STOMP, | |to send background job | |notifications. RabbitMQ is | |no longer a hard dependency | |of the Debian packages: | |`rabbitmq-server` is only | |suggested. Background job | |workers are still required. | | | |**Changed system | |preferences** | |- `JobsNotificationMethod` | |(default: polling, | |previously STOMP) - applies | |to new installations. STOMP | |is still available. | | | |**Upgrade notes** | |- Existing sites keep their | |current | |`JobsNotificationMethod` | |setting. | |- Sites that use STOMP with | |a local RabbitMQ broker | |should run `apt-mark manual | |rabbitmq-server`, so the | |broker is not removed as an | |unneeded automatic | |dependency. See the Debian | |NEWS for `koha-common` for | |details. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org