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