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