MySQL 9.0.0
Source Code Documentation
recovery_metadata_joiner_information.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 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 GR_RECOVERY_METADATA_JOINER_INCLUDE
25#define GR_RECOVERY_METADATA_JOINER_INCLUDE
26
27#include <string>
28#include <vector>
29
31
33 public:
34 /**
35 Constructor
36 */
37 Recovery_metadata_joiner_information(const std::string &view_id)
38 : m_joiner_view_id(view_id) {}
39
40 /**
41 Destructor
42 */
44
45 /**
46 Is the member joiner and waiting for the recovery metadata.
47
48 @return the send status
49 @retval true Member is joiner and waiting for recovery metadata.
50 @retval false Member is not joiner.
51 */
53
54 /**
55 Does the metadata belongs to the joiners for which it was waiting?
56
57 @param view_id The view ID of which metadata has to be compared
58
59 @return the send status
60 @retval true View-ID matches with the metadata in which joiner joined
61 @retval false View-ID does not match with the metadata in which joiner
62 joined
63 */
64 bool is_joiner_recovery_metadata(const std::string &view_id);
65
66 /**
67 Is there any member in the group that has the recovery metadata for the
68 joiner?
69
70 @return the send status
71 @retval true Atleast 1 server in the group has recovery metadata for the
72 joiner.
73 @retval false No server in the group has recovery metadata for the
74 joiner.
75 */
77
78 /**
79 Saves the GCS Member ID of the metadata senders i.e. members that were
80 ONLINE when the join request was received. This members will save the
81 recovery metadata till the joiner receives it.
82
83 @param valid_senders GCS Member ID of the member having recovery
84 metadata
85 */
87 const std::vector<Gcs_member_identifier> &valid_senders);
88
89 /**
90 Delete the members that have left the group from the stored GCS Member ID of
91 the valid sender list.
92
93 @param member_left GCS Member ID of the member left the group.
94 */
96 std::vector<Gcs_member_identifier> member_left);
97
98 private:
99 /** Stores valid recovery metadata senders for joiner. */
100 std::vector<Gcs_member_identifier> m_valid_senders_for_joiner;
101
102 /** View ID on which joiner joined */
103 const std::string m_joiner_view_id;
104};
105
106#endif /* GR_RECOVERY_METADATA_JOINER_INCLUDE */
Definition: recovery_metadata_joiner_information.h:32
void delete_leaving_members_from_sender(std::vector< Gcs_member_identifier > member_left)
Delete the members that have left the group from the stored GCS Member ID of the valid sender list.
Definition: recovery_metadata_joiner_information.cc:45
bool is_valid_sender_list_empty()
Is there any member in the group that has the recovery metadata for the joiner?
Definition: recovery_metadata_joiner_information.cc:35
virtual ~Recovery_metadata_joiner_information()
Destructor.
Definition: recovery_metadata_joiner_information.h:43
bool is_member_waiting_on_metadata()
Is the member joiner and waiting for the recovery metadata.
Definition: recovery_metadata_joiner_information.cc:26
const std::string m_joiner_view_id
View ID on which joiner joined.
Definition: recovery_metadata_joiner_information.h:103
bool is_joiner_recovery_metadata(const std::string &view_id)
Does the metadata belongs to the joiners for which it was waiting?
Definition: recovery_metadata_joiner_information.cc:30
std::vector< Gcs_member_identifier > m_valid_senders_for_joiner
Stores valid recovery metadata senders for joiner.
Definition: recovery_metadata_joiner_information.h:100
void set_valid_sender_list_of_joiner(const std::vector< Gcs_member_identifier > &valid_senders)
Saves the GCS Member ID of the metadata senders i.e.
Definition: recovery_metadata_joiner_information.cc:39
Recovery_metadata_joiner_information(const std::string &view_id)
Constructor.
Definition: recovery_metadata_joiner_information.h:37