MySQL 8.4.2
Source Code Documentation
leave_group_on_failure.h
Go to the documentation of this file.
1/* Copyright (c) 2019, 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 LEAVE_GROUP_ON_FAILURE_INCLUDED
25#define LEAVE_GROUP_ON_FAILURE_INCLUDED
26
27#include <bitset>
28
29#include "my_inttypes.h"
31
32/**
33 Structure that holds the actions taken by the plugin when the
34 member leaves the group after a failure.
35*/
37 /**
38 @enum enum_actions
39 @brief Actions taken by the plugin when the member leaves the
40 group after a failure.
41 */
51 };
52 using mask = std::bitset<ACTION_MAX>;
53
54 /**
55 Do the instructed actions after a failure.
56
57 @param[in] actions
58 Actions performed.
59 @param[in] error_to_log
60 Error logged into error log.
61 @param[in] caller_notification_context
62 If defined the member state change notification
63 will update this notification context and the
64 notification signal responsibility belongs to the
65 caller.
66 If not defined (nullptr) a notification will be
67 sent by this function.
68 @param[in] exit_state_action_abort_log_message
69 The log message used on abort_plugin_process() if
70 that function is called.
71 */
72 static void leave(const mask &actions, longlong error_to_log,
73 Notification_context *caller_notification_context,
74 const char *exit_state_action_abort_log_message);
75};
76
77#endif /* LEAVE_GROUP_ON_FAILURE_INCLUDED */
A convenience context class used to share information between the event handlers and the notifier.
Definition: notification.h:35
Some integer typedefs for easier portability.
long long int longlong
Definition: my_inttypes.h:55
Structure that holds the actions taken by the plugin when the member leaves the group after a failure...
Definition: leave_group_on_failure.h:36
std::bitset< ACTION_MAX > mask
Definition: leave_group_on_failure.h:52
enum_actions
Actions taken by the plugin when the member leaves the group after a failure.
Definition: leave_group_on_failure.h:42
@ SKIP_LEAVE_VIEW_WAIT
Definition: leave_group_on_failure.h:45
@ ALREADY_LEFT_GROUP
Definition: leave_group_on_failure.h:43
@ CLEAN_GROUP_MEMBERSHIP
Definition: leave_group_on_failure.h:46
@ ACTION_MAX
Definition: leave_group_on_failure.h:50
@ SKIP_SET_READ_ONLY
Definition: leave_group_on_failure.h:44
@ HANDLE_AUTO_REJOIN
Definition: leave_group_on_failure.h:49
@ HANDLE_EXIT_STATE_ACTION
Definition: leave_group_on_failure.h:48
@ STOP_APPLIER
Definition: leave_group_on_failure.h:47
static void leave(const mask &actions, longlong error_to_log, Notification_context *caller_notification_context, const char *exit_state_action_abort_log_message)
Do the instructed actions after a failure.
Definition: leave_group_on_failure.cc:36