MySQL 8.0.39
Source Code Documentation
gcs_group_management_interface.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef GCS_GROUP_MANAGEMENT_INTERFACE_INCLUDED
25#define GCS_GROUP_MANAGEMENT_INTERFACE_INCLUDED
26
29
30#include <cstdint>
31
33 public:
34 /**
35 Method that allows sending of a new group configuration. This is
36 to be used when the group is blocked due to a loss of majority and
37 only on one node from the new group.
38
39 Implementations in each binding might have there specificities but some
40 rules must be followed:
41 - This should be a non-blocking call;
42 - Typically, it shall cause a View Change, since we are forcing a new
43 configuration.
44
45 @param[in] reconfigured_group a list containing the new nodes
46 */
47
49 const Gcs_interface_parameters &reconfigured_group) = 0;
50
51 /**
52 Retrieves the minimum supported "write concurrency" value.
53 */
54 virtual uint32_t get_minimum_write_concurrency() const = 0;
55
56 /**
57 Retrieves the maximum supported "write concurrency" value.
58 */
59 virtual uint32_t get_maximum_write_concurrency() const = 0;
60
61 /**
62 Retrieves the group's "write concurrency" value.
63
64 @param[out] write_concurrency A reference to where the group's
65 "write concurrency" value will be written to
66
67 @retval GCS_OK if successful and write_concurrency has been written to
68 @retval GCS_NOK if GCS was unable to request the current "write concurrency"
69 value from the underlying implementation
70 */
72 uint32_t &write_concurrency) const = 0;
73
74 /**
75 Reconfigures the group's "write concurrency" value.
76
77 The caller should ensure that the supplied value is between @c
78 minimum_write_concurrency and @c maximum_write_concurrency.
79
80 The method is non-blocking, meaning that it shall only send the request to
81 an underlying GCS. The final result can be polled via @c
82 get_write_concurrency.
83
84 @param write_concurrency The desired "write concurrency" value.
85
86 @retval GCS_OK if successful
87 @retval GCS_NOK if unsuccessful
88 */
89 virtual enum_gcs_error set_write_concurrency(uint32_t write_concurrency) = 0;
90
92
93 /**
94 * @brief Reconfigures the group's "consensus leaders."
95 *
96 * Instructs the underlying GCS to use @c leader as the single preferred
97 * consensus leader.
98 *
99 * @param leader The member you desire to act as a consensus leader.
100 *
101 * @retval GCS_OK if successful
102 * @retval GCS_NOK if unsuccessful
103 */
105 Gcs_member_identifier const &leader) = 0;
106
107 /**
108 * @brief Reconfigures the group's "consensus leaders."
109 *
110 * Instructs the underlying GCS to use every member as a consensus leader.
111 *
112 * @retval GCS_OK if successful
113 * @retval GCS_NOK if unsuccessful
114 */
116
117 /**
118 * @brief Inspect the group's "consensus leader" configuration.
119 *
120 * @param[out] preferred_leaders The members specified as preferred leaders.
121 * @param[out] actual_leaders The members actually carrying out the leader
122 * role at this moment.
123 *
124 * @retval GCS_OK if successful, @c preferred_leaders and @c actual_leaders
125 * contain the result
126 * @retval GCS_NOK if unsuccessful
127 */
129 std::vector<Gcs_member_identifier> &preferred_leaders,
130 std::vector<Gcs_member_identifier> &actual_leaders) = 0;
131};
132
133#endif // GCS_GROUP_MANAGEMENT_INTERFACE_INCLUDED
Definition: gcs_group_management_interface.h:32
virtual enum_gcs_error set_single_leader(Gcs_member_identifier const &leader)=0
Reconfigures the group's "consensus leaders.".
virtual enum_gcs_error modify_configuration(const Gcs_interface_parameters &reconfigured_group)=0
Method that allows sending of a new group configuration.
virtual enum_gcs_error get_write_concurrency(uint32_t &write_concurrency) const =0
Retrieves the group's "write concurrency" value.
virtual enum_gcs_error get_leaders(std::vector< Gcs_member_identifier > &preferred_leaders, std::vector< Gcs_member_identifier > &actual_leaders)=0
Inspect the group's "consensus leader" configuration.
virtual uint32_t get_maximum_write_concurrency() const =0
Retrieves the maximum supported "write concurrency" value.
virtual uint32_t get_minimum_write_concurrency() const =0
Retrieves the minimum supported "write concurrency" value.
virtual enum_gcs_error set_write_concurrency(uint32_t write_concurrency)=0
Reconfigures the group's "write concurrency" value.
virtual ~Gcs_group_management_interface()=default
virtual enum_gcs_error set_everyone_leader()=0
Reconfigures the group's "consensus leaders.".
This class is to be used to provide parameters to bindings in a transparent and generic way.
Definition: gcs_types.h:59
It represents the identity of a group member within a certain group.
Definition: gcs_member_identifier.h:40
enum_gcs_error
This enumeration describes errors which can occur during group communication operations.
Definition: gcs_types.h:41