MySQL 8.3.0
Source Code Documentation
communication_protocol_action.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef COMMUNICATION_PROTOCOL_ACTION_INCLUDED
24#define COMMUNICATION_PROTOCOL_ACTION_INCLUDED
25
26#include <future>
32
33/**
34 Action that changes the GCS protocol version in use by the group.
35
36 Note that this action's logic is actually done in process_action_message
37 instead of execute_action. This is because process_action_message is executed
38 in the same logical instant on all group members (in the GCS thread) while
39 execute_action is executed nondeterministically on its own thread.
40*/
42 public:
46
47 // Group_action implementation
48 void get_action_message(Group_action_message **message) final;
50 const std::string &message_origin) final;
52 bool invoking_member, Plugin_stage_monitor_handler *stage_handler,
53 Notification_context *) final;
54 bool stop_action_execution(bool killed) final;
56
57 private:
58 int set_consensus_leaders() const;
59
60 /** Stores textual information about the action's execution. */
62
63 /** The GCS protocol to change to. */
65
66 /**
67 * Future on which to wait for the protocol change to finish in the local
68 * node.
69 */
71};
72
73#endif /* COMMUNICATION_PROTOCOL_ACTION_INCLUDED */
Action that changes the GCS protocol version in use by the group.
Definition: communication_protocol_action.h:41
Group_action_diagnostics m_diagnostics
Stores textual information about the action's execution.
Definition: communication_protocol_action.h:61
int process_action_message(Group_action_message &message, const std::string &message_origin) final
Definition: communication_protocol_action.cc:77
bool stop_action_execution(bool killed) final
Definition: communication_protocol_action.cc:129
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:70
Gcs_protocol_version m_gcs_protocol
The GCS protocol to change to.
Definition: communication_protocol_action.h:64
Communication_protocol_action()
Definition: communication_protocol_action.cc:32
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:120
int set_consensus_leaders() const
Definition: communication_protocol_action.cc:50
void get_action_message(Group_action_message **message) final
Get the message with parameters to this action.
Definition: communication_protocol_action.cc:44
Group_action_diagnostics * get_execution_info() final
Gets the info about execution, be it success or failure.
Definition: communication_protocol_action.cc:134
The parent class for group wide operations.
Definition: group_action.h:34
Definition: group_action_message.h:32
The parent class for group wide operations.
Definition: group_action.h:138
enum_action_execution_result
Enum for the end results of a action execution.
Definition: group_action.h:141
A convenience context class used to share information between the event handlers and the notifier.
Definition: notification.h:34
Definition: stage_monitor_handler.h:29
Gcs_protocol_version
The GCS protocol versions.
Definition: gcs_types.h:127
Definition: varlen_sort.h:174