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

pglookout: support explicit failover priorities #125

Merged

Conversation

hnousiainen
Copy link
Contributor

Support explicit prioritization between instances. This can be configured via failover_priorities key, and will be consulted upon picking up the standby that should do the promotion in cases where multiple nodes have a matching replication position.

Previously, and also as the current default, the selection was based on the sorting order of the remote nodes.

The configuration option allows some additional flexibility, and supports e.g. topologies where we have more favorable and less desirable standbys in multiple different network locations.

@hnousiainen hnousiainen force-pushed the htn_pglookout_failover_priorities branch from 1b86c58 to bfc997d Compare December 4, 2024 21:49
Copy link
Contributor

@rdunklau rdunklau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we going to synchronize the configuration for failover priorities ?

It seems quite dangerous to me that we could have separate nodes favoring themselves, leading to split brain scenarios.

@hnousiainen
Copy link
Contributor Author

How are we going to synchronize the configuration for failover priorities ?

It seems quite dangerous to me that we could have separate nodes favoring themselves, leading to split brain scenarios.

In Aiven case, this would be based on the configuration delivered to the services. The priorities help to replace the implicit prioritization via instance identifies with explicit order, but both list are indeed generated from a common config.

@rdunklau
Copy link
Contributor

The pipeline fails for a rather silly reason:
  test/test_lookout.py:1:0: C0302: Too many lines in module (1302/1300) (too-many-lines)

@hnousiainen hnousiainen force-pushed the htn_pglookout_failover_priorities branch from bfc997d to 3cae7d6 Compare December 19, 2024 23:20
@hnousiainen
Copy link
Contributor Author

The pipeline fails for a rather silly reason:   test/test_lookout.py:1:0: C0302: Too many lines in module (1302/1300) (too-many-lines)

Thank you. I added a quick commit to move some helper functions from test/test_lookout.py into test/utils.py in order to compact the test file a bit.

@hnousiainen hnousiainen force-pushed the htn_pglookout_failover_priorities branch from 3cae7d6 to 65662c3 Compare December 20, 2024 07:50
@hnousiainen hnousiainen force-pushed the htn_pglookout_failover_priorities branch 4 times, most recently from f7704d3 to 663eee4 Compare January 3, 2025 12:04
Export test helper functions from test/test_lookout.py into a separate
common test/utils.py module.

This doesn't change any actual functionality, but makes test_lookout
little more compact.
Support explicit prioritization between instances. This can be
configured via ``failover_priorities`` key, and will be consulted
upon picking up the standby that should do the promotion in cases
where multiple nodes have a matching replication position.

Previously, and also as the current default, the selection was based
on the sorting order of the remote nodes.

The configuration option allows some additional flexibility, and
supports e.g. topologies where we have more favorable and less
desirable standbys in multiple different network locations.
@hnousiainen hnousiainen force-pushed the htn_pglookout_failover_priorities branch from 663eee4 to 56fc154 Compare January 3, 2025 12:20
@hnousiainen hnousiainen requested a review from rdunklau January 7, 2025 10:57
@rdunklau rdunklau merged commit f486efe into Aiven-Open:main Jan 13, 2025
19 checks passed
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