Skip to content

make NODES=3 NODES_ASYNC=2 NODES_PRIOS=50,0 NODES_SYNC_SB=0 cluster#551

Merged
DimCitus merged 2 commits intomasterfrom
fix/make-cluster-candidate-priorities
Jan 15, 2021
Merged

make NODES=3 NODES_ASYNC=2 NODES_PRIOS=50,0 NODES_SYNC_SB=0 cluster#551
DimCitus merged 2 commits intomasterfrom
fix/make-cluster-candidate-priorities

Conversation

@DimCitus
Copy link
Copy Markdown
Collaborator

@DimCitus DimCitus commented Dec 14, 2020

This PR allows to setup an interactive testing/QA cluster with tmux with
full specifications of nodes replication settings. Before that the code was
conflating the replicationQuorum and the candidatePriority of nodes, and
that was limiting our testing abilities.

When unspecified, nodes are all created with --candidate-priority 0. Then it
is possible to specify one or more candidate priorities, which are used in
the order given. When more nodes are created than priorities are given, we
use the last specified priority again and again.

For instance --node-priorities 50,0 --nodes 3 results in using 50,0,0 as the
respective priorities for the nodes thus created.

@DimCitus DimCitus added Size: S Effort Estimate: Small Developer productivity Enhancements to ability to ship quality code labels Dec 14, 2020
@DimCitus DimCitus added this to the Sprint 2020 W50 W51 milestone Dec 14, 2020
@DimCitus DimCitus requested a review from JelteF December 14, 2020 11:53
@DimCitus DimCitus self-assigned this Dec 14, 2020
@DimCitus DimCitus force-pushed the fix/make-cluster-candidate-priorities branch from 72ca9d5 to 15b65b1 Compare December 14, 2020 13:24
Comment thread src/bin/pg_autoctl/cli_do_tmux.c Outdated
Comment thread src/bin/pg_autoctl/cli_do_tmux.c
Comment thread src/bin/pg_autoctl/cli_do_tmux.c Outdated
options->root,
firstNode,
NodeStateToString(PRIMARY_STATE));
NodeStateToString(WAIT_PRIMARY_STATE));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Because of this change I now get this error when running this command:

make -j20 NODES=6 NODES_SYNC_SB=5 cluster
13:53:15 11041 ERROR Monitor ERROR:  invalid value for number_sync_standbys: "5"
13:53:15 11041 ERROR Monitor DETAIL:  At least 6 standby nodes are required, and only 2 are currently participating in the replication quorum
13:53:15 11041 ERROR SQL query: SELECT pgautofailover.set_formation_number_sync_standbys($1, $2)
13:53:15 11041 ERROR SQL params: 'default', '5'
13:53:15 11041 ERROR Failed to update number-sync-standbys for formation "default".
13:53:15 11041 ERROR Failed to set "number-sync-standbys" to "5".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Without this change we can't make -j20 NODES=3 NODES_SYNC_SB=0 NODES_ASYNC=3 cluster if I remember correctly... maybe we need to be smarter about what we want to wait for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

So, even when waiting until primary, you can't have number-sync-standbys set to 5 with... 5 standby nodes (NODES=6, total). Still, we need to wait for primary when the target number-sync-standbys setting is one or more, now fixed.

This PR allows to setup an interactive testing/QA cluster with tmux with
full specifications of nodes replication settings. Before that the code was
conflating the replicationQuorum and the candidatePriority of nodes, and
that was limiting our testing abilities.

When unspecified, nodes are all created with --candidate-priority 0. Then it
is possible to specify one or more candidate priorities, which are used in
the order given. When more nodes are created than priorities are given, we
use the last specified priority again and again.

For instance --node-priorities 50,0 --nodes 3 results in using 50,0,0 as the
respective priorities for the nodes thus created.
@DimCitus DimCitus force-pushed the fix/make-cluster-candidate-priorities branch from 15b65b1 to bc37092 Compare January 11, 2021 15:00
@DimCitus DimCitus merged commit 748ab2e into master Jan 15, 2021
@DimCitus DimCitus deleted the fix/make-cluster-candidate-priorities branch January 15, 2021 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Developer productivity Enhancements to ability to ship quality code Size: S Effort Estimate: Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants