MySQL 8.4.2
Source Code Documentation
xcom_interface.h
Go to the documentation of this file.
1/* Copyright (c) 2015, 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 XCOM_INTERFACE_H
25#define XCOM_INTERFACE_H
26
27#include "xcom/site_struct.h"
28#include "xcom/xcom_cache.h"
29
30void deliver_view_msg(site_def const *site);
31void deliver_global_view_msg(site_def const *site, node_set const ns,
32 synode_no message_id);
33
34/**
35 Delivers the @c app payload to XCom's upper layer, e.g. GCS.
36
37 Please note the following contract regarding the parameter of this function:
38 If @c app_status is @c delivery_ok, then it means that XCom reached
39 consensus on @c app. In this situation, @c pma MUST point to the Paxos
40 instance (@c pax_machine) where @c app got consensus on. In other words, @c
41 pma MUST NOT be NULL.
42
43 In summary, this function is expected to be called as follows if a payload
44 @c p reached consensus:
45
46 deliver_to_app(<pointer to pax_machine where p was decided>, p, delivery_ok)
47
48 This function is expected to be called as follows if a payload @c p did NOT
49 reach consensus:
50
51 deliver_to_app(_, p, delivery_failure)
52
53 Where the @c pma argument may be a pointer to the pax_machine where @c p
54 failed to get consensus, or NULL.
55
56 Failure do adhere to this contract will result in an assert failure, at least
57 on non-release builds.
58
59 @param pma The Paxos instance where the @c app payload obtained consensus
60 @param app The payload that was decided for the Paxos instance @c pma
61 @param app_status The reason for @c app delivery: @c delivery_ok if the @c app
62 payload reached consensus on the @c pma Paxos instance, or @c delivery_failure
63 if XCom was unable to reach consensus
64 */
65void deliver_to_app(pax_machine *pma, app_data_ptr app,
66 delivery_status app_status);
67
68void deliver_config(app_data_ptr a);
69
71
72#endif
Definition: xcom_cache.h:95
Definition: site_struct.h:43
void deliver_to_app(pax_machine *pma, app_data_ptr app, delivery_status app_status)
Delivers the app payload to XCom's upper layer, e.g.
Definition: xcom_interface.cc:114
void deliver_config(app_data_ptr a)
Definition: xcom_interface.cc:231
void deliver_view_msg(site_def const *site)
Deliver a view message.
Definition: xcom_interface.cc:186
void deinit_xcom_interface()
Definition: xcom_interface.cc:239
void deliver_global_view_msg(site_def const *site, node_set const ns, synode_no message_id)
Definition: xcom_interface.cc:211