MySQL 8.3.0
Source Code Documentation
group_membership_listener.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 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 GROUP_MEMBERSHIP_LISTENER_H
24#define GROUP_MEMBERSHIP_LISTENER_H
25
27
28/**
29 A service that listens for notifications about view changes or
30 quorum loss.
31*/
32BEGIN_SERVICE_DEFINITION(group_membership_listener)
33/**
34 This function SHALL be called whenever there is a new view
35 installed.
36
37 The implementation SHALL consume the notification and
38 return false on success, true on failure.
39
40 The implementation MUST NOT block the caller. It MUST
41 handle the notification quickly or enqueue it and deal
42 with it asynchronously.
43
44 @param view_id The view identifier. This must be copied
45 if the string must outlive the notification
46 lifecycle.
47
48 @return false success, true on failure.
49*/
50DECLARE_BOOL_METHOD(notify_view_change, (const char *view_id));
51
52/**
53 This function SHALL be called whenever the state of a member
54 changes to UNREACHABLE and that makes the system block.
55
56 The implementation SHALL consume the notification and
57 return false on success, true on failure.
58
59 The implementation MUST NOT block the caller. It MUST
60 handle the notification quickly or enqueue it and deal
61 with it asynchronously.
62
63 @param view_id The view identifier. This must be copied
64 if the string must outlive the notification
65 lifecycle.
66
67 @return false success, true on failure.
68*/
69DECLARE_BOOL_METHOD(notify_quorum_loss, (const char *view_id));
70
71END_SERVICE_DEFINITION(group_membership_listener)
72
73#endif /* GROUP_MEMBERSHIP_LISTENER_H */
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:111