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