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