MySQL 8.0.40
Source Code Documentation
communication_protocol_action.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 COMMUNICATION_PROTOCOL_ACTION_INCLUDED
25#define COMMUNICATION_PROTOCOL_ACTION_INCLUDED
26
27#include <future>
33
34/**
35 Action that changes the GCS protocol version in use by the group.
36
37 Note that this action's logic is actually done in process_action_message
38 instead of execute_action. This is because process_action_message is executed
39 in the same logical instant on all group members (in the GCS thread) while
40 execute_action is executed nondeterministically on its own thread.
41*/
43 public:
47
48 // Group_action implementation
49 void get_action_message(Group_action_message **message) final;
51 const std::string &message_origin) final;
53 bool invoking_member, Plugin_stage_monitor_handler *stage_handler,
54 Notification_context *) final;
55 bool stop_action_execution(bool killed) final;
57
58 private:
59 int set_consensus_leaders() const;
60
61 /** Stores textual information about the action's execution. */
63
64 /** The GCS protocol to change to. */
66
67 /**
68 * Future on which to wait for the protocol change to finish in the local
69 * node.
70 */
72};
73
74#endif /* COMMUNICATION_PROTOCOL_ACTION_INCLUDED */
Action that changes the GCS protocol version in use by the group.
Definition: communication_protocol_action.h:42
Group_action_diagnostics m_diagnostics
Stores textual information about the action's execution.
Definition: communication_protocol_action.h:62
int process_action_message(Group_action_message &message, const std::string &message_origin) final
Definition: communication_protocol_action.cc:78
bool stop_action_execution(bool killed) final
Definition: communication_protocol_action.cc:130
std::future< void > m_protocol_change_done
Future on which to wait for the protocol change to finish in the local node.
Definition: communication_protocol_action.h:71
Gcs_protocol_version m_gcs_protocol
The GCS protocol to change to.
Definition: communication_protocol_action.h:65
Communication_protocol_action()
Definition: communication_protocol_action.cc:33
enum_action_execution_result execute_action(bool invoking_member, Plugin_stage_monitor_handler *stage_handler, Notification_context *) final
Execute the action.
Definition: communication_protocol_action.cc:121
int set_consensus_leaders() const
Definition: communication_protocol_action.cc:51
void get_action_message(Group_action_message **message) final
Get the message with parameters to this action.
Definition: communication_protocol_action.cc:45
Group_action_diagnostics * get_execution_info() final
Gets the info about execution, be it success or failure.
Definition: communication_protocol_action.cc:135
The parent class for group wide operations.
Definition: group_action.h:35
Definition: group_action_message.h:33
The parent class for group wide operations.
Definition: group_action.h:139
enum_action_execution_result
Enum for the end results of a action execution.
Definition: group_action.h:142
A convenience context class used to share information between the event handlers and the notifier.
Definition: notification.h:35
Definition: stage_monitor_handler.h:30
Gcs_protocol_version
The GCS protocol versions.
Definition: gcs_types.h:128
Definition: gcs_xcom_synode.h:64