MySQL 8.0.40
Source Code Documentation
primary_election_include.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 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 PRIMARY_ELECTION_INCLUDE_INCLUDED
25#define PRIMARY_ELECTION_INCLUDE_INCLUDED
26
27/** The server version in which member weight was introduced.*/
28#define PRIMARY_ELECTION_MEMBER_WEIGHT_VERSION 0x050720
29/** The server version in which online leader elections were introduced */
30#define PRIMARY_ELECTION_LEGACY_ALGORITHM_VERSION 0x080013
31
32/** Enum for election types */
34 SAFE_OLD_PRIMARY = 0, // Migrating from multi primary to single primary
35 UNSAFE_OLD_PRIMARY = 1, // Changing from one primary to another
36 DEAD_OLD_PRIMARY = 2, // Old primary died
37 LEGACY_ELECTION_PRIMARY = 3, // Electing a primary using legacy election
38 ELECTION_MODE_END = 4 // Enum end
39};
40
41/** Enum for election errors */
43 PRIMARY_ELECTION_NO_ERROR = 0, // No errors
44 PRIMARY_ELECTION_NO_CANDIDATES_ERROR = 1, // No candidates for election
45 PRIMARY_ELECTION_PROCESS_ERROR = 2, // There was a problem in the election
46 PRIMARY_ELECTION_ERROR_END = 3 // Enum end
47};
48
49/** Enum for primary change status */
51 PRIMARY_CHANGE_INIT = 0, // Primary change still running
52 PRIMARY_DID_CHANGE = 1, // Primary changes successfully
54 2, // Primary changed with error like cannot send
55 // message to other members, or cannot changed
56 // variables etc., member will move to ERROR state
58 3, // Primary member is not present or primary cannot
59 // be selected, no servers in the group
60 PRIMARY_DID_NOT_CHANGE = 4, // Primary did not change
62 5, // Primary member left during election, end the election for a new
63 // election to start
64};
65#endif /* PRIMARY_ELECTION_INCLUDE_INCLUDED */
enum_primary_election_mode
Enum for election types.
Definition: primary_election_include.h:33
@ ELECTION_MODE_END
Definition: primary_election_include.h:38
@ SAFE_OLD_PRIMARY
Definition: primary_election_include.h:34
@ DEAD_OLD_PRIMARY
Definition: primary_election_include.h:36
@ UNSAFE_OLD_PRIMARY
Definition: primary_election_include.h:35
@ LEGACY_ELECTION_PRIMARY
Definition: primary_election_include.h:37
enum_primary_election_error
Enum for election errors.
Definition: primary_election_include.h:42
@ PRIMARY_ELECTION_PROCESS_ERROR
Definition: primary_election_include.h:45
@ PRIMARY_ELECTION_ERROR_END
Definition: primary_election_include.h:46
@ PRIMARY_ELECTION_NO_ERROR
Definition: primary_election_include.h:43
@ PRIMARY_ELECTION_NO_CANDIDATES_ERROR
Definition: primary_election_include.h:44
enum_primary_election_primary_change_status
Enum for primary change status.
Definition: primary_election_include.h:50
@ PRIMARY_CHANGE_INIT
Definition: primary_election_include.h:51
@ PRIMARY_DID_CHANGE_WITH_ERROR
Definition: primary_election_include.h:53
@ PRIMARY_DID_NOT_CHANGE_PRIMARY_LEFT_FORCE_ELECTION_END
Definition: primary_election_include.h:61
@ PRIMARY_DID_CHANGE
Definition: primary_election_include.h:52
@ PRIMARY_DID_NOT_CHANGE
Definition: primary_election_include.h:60
@ PRIMARY_DID_NOT_CHANGE_NO_CANDIDATE
Definition: primary_election_include.h:57