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