-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added replication section to main configuration
Added 'easymysql::replication_config' class with two fields: * 'server_id' - the ID of the MySQL pseudo server that will be send to the server when switching connection to replication mode. * 'idle_time' - the number of seconds the utility will wait between reconnection attempts. Both parameters can be specified both in JSON configuration file and via command line arguments. Sample JSON configuration file ('main_config.json') and 'binlog_streaming.binsrv' MTR test case updated correspondingly. After this change the replication connection (after reading all available binlog events) will wait for '<connection.read_timeout>' seconds, then will close the connection and will wait for '<replication.idle_time>' seconds before trying to reconnect. Logging of connection configuration info and replication configuration info moved from the 'main()' into separate functions: * 'log_connection_config_info()' * 'log_replication_info()'
- Loading branch information
1 parent
2c272e1
commit 83a9d25
Showing
7 changed files
with
134 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2023-2024 Percona and/or its affiliates. | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License, version 2.0, | ||
// as published by the Free Software Foundation. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License, version 2.0, for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
#ifndef EASYMYSQL_REPLICATION_CONFIG_HPP | ||
#define EASYMYSQL_REPLICATION_CONFIG_HPP | ||
|
||
#include "easymysql/replication_config_fwd.hpp" // IWYU pragma: export | ||
|
||
#include <cstdint> | ||
|
||
#include "util/nv_tuple.hpp" | ||
|
||
namespace easymysql { | ||
|
||
struct [[nodiscard]] replication_config | ||
: util::nv_tuple< | ||
// clang-format off | ||
util::nv<"server_id", std::uint32_t>, | ||
util::nv<"idle_time", std::uint32_t> | ||
// clang-format on | ||
> {}; | ||
|
||
} // namespace easymysql | ||
|
||
#endif // EASYMYSQL_REPLICATION_CONFIG_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) 2023-2024 Percona and/or its affiliates. | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License, version 2.0, | ||
// as published by the Free Software Foundation. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License, version 2.0, for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
#ifndef EASYMYSQL_REPLICATION_CONFIG_FWD_HPP | ||
#define EASYMYSQL_REPLICATION_CONFIG_FWD_HPP | ||
|
||
namespace easymysql { | ||
|
||
struct replication_config; | ||
|
||
} // namespace easymysql | ||
|
||
#endif // EASYMYSQL_REPLICATION_CONFIG_FWD_HPP |