sap_ha_pacemaker_cluster: several bug fixes#965
Merged
Conversation
- fixed a conditional that failed in check-mode - added tag to allow running in check-mode without executing ha_cluster
During the previous change of the stonith code a conditional was removed that did not apply to the GCP default, but is required for other platform default stonith resources that use host maps.
This fixes the HANA VIP colocation constraint conditional to always apply the base score and recalculate only when HANA-VIP resource groups are present in the definition. Assigning new values inside blocks/loops does not work (anymore) and and a namespace object has to be used instead. Reference: https://jinja.palletsprojects.com/en/latest/templates/#assignments
Same as in commit c6935e4, but for the task about the read-only VIP.
marcelmamula
approved these changes
Feb 13, 2025
Contributor
marcelmamula
left a comment
There was a problem hiding this comment.
LGTM, tested ASCS/ERS and HANA HA clusters on GCP.
- fixes the hook dict definition for mixed setups - adds a check to prevent invalid host type combinations
Contributor
Author
|
@marcelmamula Sorry, I added one more small fix/enhancement for the topic. :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few bugs started showing during new tests and need fixing.
The combination of fixes was tested on AWS using
1. Regression fix: Stonith resource duplicate definition
During the previous change of the stonith code a conditional was removed that did not apply to the GCP default, but is required for other platform default stonith resources that use host maps.
2. Fix: Check-mode
Fixed a conditional that failed in check-mode. The .stout var is always defined, but can be empty and that fails the version comparison in the last conditional.
3. Fix: HANA VIP colocation score calculation
This fixes the HANA VIP colocation constraint conditional to always apply the base score and recalculate only when HANA-VIP resource groups are present in the definition.
The previous code enhanced with an
elsein the loop for a default score ended up appending the loop results as strings.Due to the combination of HANA and NW resource definitions the group loop was processed put the if-conditional does not match, so the issue started showing up in the form of an empty score returned due a missing fallback value inside the for-loop. This causes the ha_cluster role to fail when trying to apply the constraint.
The change to variable assignment was done to overcome the issue with the loop appending results instead of overriding one value.
Assigning new values inside blocks/loops does not work (anymore) and a namespace object has to be used instead.
Reference: https://jinja.palletsprojects.com/en/latest/templates/#assignments
4. Mini enhancement: tag ha_cluster role import task
Added a tag to allow running without executing the ha_cluster role by skipping the tag
run_ha_cluster.This speeds up the construction of the input config file for debugging purpose and could also be used to run everything else without recreating the cluster config again.
Example usage that saves ~7 minutes of execution time just for producing the input parameters for review:
5. Enhancement: flexibility for combined setups