Skip to content
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

Fix box.ctl.promote error handling #2291

Merged
merged 4 commits into from
Dec 26, 2024
Merged

Fix box.ctl.promote error handling #2291

merged 4 commits into from
Dec 26, 2024

Conversation

yngvar-antonsson
Copy link
Collaborator

@yngvar-antonsson yngvar-antonsson commented Dec 19, 2024

This pull request focuses on improving error handling and logging in the cartridge/failover.lua file. The most important changes include ensuring that errors from box.ctl.promote and box.ctl.demote are properly logged and handled, and that the raft_failover.disable function handles errors correctly.

Improved error handling and logging:

  • cartridge/failover.lua: Changed the synchro_promote and synchro_demote functions to use pcall for error handling and added logging for errors. [1] [2]
  • cartridge/failover.lua: Updated the reconfigure_all function to handle errors from synchro_promote by raising an error if synchro_promote fails.
  • cartridge/failover.lua: Modified the cfg function to handle errors from synchro_promote, synchro_demote, and raft_failover.disable by raising ApplyConfigError if any of these functions fail. [1] [2] [3]
  • cartridge/failover/raft.lua: Updated the disable function to use pcall for error handling and added logging for errors.

Documentation:

  • CHANGELOG.rst: Added a note indicating that errors from box.ctl.promote and box.ctl.demote are now logged.

I didn't forget about

  • Changelog

cartridge/failover.lua Outdated Show resolved Hide resolved
cartridge/failover/raft.lua Outdated Show resolved Hide resolved
cartridge/failover/raft.lua Outdated Show resolved Hide resolved
cartridge/failover.lua Outdated Show resolved Hide resolved
cartridge/failover.lua Outdated Show resolved Hide resolved
@yngvar-antonsson yngvar-antonsson merged commit d68a666 into master Dec 26, 2024
24 of 25 checks passed
@yngvar-antonsson yngvar-antonsson deleted the fix-promote branch December 26, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants