MySQL  8.0.27
Source Code Documentation
rpl_async_conn_failover.h
Go to the documentation of this file.
1 /* Copyright (c) 2020, 2021, 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 RPL_ASYNC_CONN_FAILOVER_H
24 #define RPL_ASYNC_CONN_FAILOVER_H
25 
27 #include "sql/rpl_mi.h"
28 
29 /*
30  The class is used to connect to new source in case the
31  current replica IO connection gets interrupted.
32 */
34  public:
39  };
40 
42 
46  delete;
48  delete;
49 
50  /**
51  Re-establishes connection to next available source.
52 
53  @param[in] mi the mi of the failed connection which
54  needs to be reconnected to the new source.
55  @param[in] force_highest_weight When true, sender with highest weight is
56  chosen, otherwise the next sender from the current one is chosen.
57 
58  @retval Please see enum_do_auto_conn_failover_error.
59  */
61  Master_info *mi, bool force_highest_weight);
62 
63  /*
64  Get source quorum status in case source has Group Replication enabled.
65 
66  @param mysql MYSQL to request uuid from source.
67  @param mi Master_info to set master_uuid
68 
69  @return 0: Success,
70  1: Fatal error,
71  2: Transient network error.
72  */
74 
75  private:
76  /**
77  Sets source network configuration details <host, port, network_namespace>
78  for the provided Master_info object. The function is used by async conn
79  failure to set configuration details of new source.
80 
81  @param[in] mi the channel of the failed connection which
82  needs to be reconnected to the new source.
83  @param[in] host the source hostname to be set for Master_info object
84  @param[in] port the source port to be set for Master_info object
85  @param[in] network_namespace the source network_namespace to be set for
86  Master_info object
87 
88  @retval true Error
89  @retval false Success
90  */
91  static bool set_channel_conn_details(Master_info *mi, const std::string host,
92  const uint port,
93  const std::string network_namespace);
94 };
95 #endif /* RPL_ASYNC_CONN_FAILOVER_H */
Definition: rpl_async_conn_failover.h:33
Async_conn_failover_manager(Async_conn_failover_manager &&)=delete
static bool set_channel_conn_details(Master_info *mi, const std::string host, const uint port, const std::string network_namespace)
Sets source network configuration details <host, port, network_namespace> for the provided Master_inf...
Definition: rpl_async_conn_failover.cc:203
static int get_source_quorum_status(MYSQL *mysql, Master_info *mi)
Definition: rpl_async_conn_failover.cc:270
Async_conn_failover_manager(const Async_conn_failover_manager &)=delete
Async_conn_failover_manager & operator=(Async_conn_failover_manager &&)=delete
enum_do_auto_conn_failover_error
Definition: rpl_async_conn_failover.h:35
@ ACF_RETRIABLE_ERROR
Definition: rpl_async_conn_failover.h:37
@ ACF_NO_SOURCES_ERROR
Definition: rpl_async_conn_failover.h:38
@ ACF_NO_ERROR
Definition: rpl_async_conn_failover.h:36
static enum_do_auto_conn_failover_error do_auto_conn_failover(Master_info *mi, bool force_highest_weight)
Re-establishes connection to next available source.
Definition: rpl_async_conn_failover.cc:52
Async_conn_failover_manager & operator=(const Async_conn_failover_manager &)=delete
Definition: rpl_mi.h:86
static MYSQL mysql
Definition: mysql.cc:153
const char * host
Definition: mysqladmin.cc:58
required string network_namespace
Definition: replication_asynchronous_connection_failover.proto:33
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
Definition: mysql.h:297
unsigned int uint
Definition: uca-dump.cc:29