ClickHouse/utils
Val Doroshchuk 5c221d123d MaterializedMySQL: Introduce MySQL Binlog Client
One binlog connection for many databases.

Suggesting to disable this feature by default for now. It should be explicitly enabled by SETTINGS use_binlog_client=1.
But if you would permanently enable it in MaterializedMySQLSettings, it should keep old behavior and all tests should pass too.

1. Introduced `IBinlog` and its impl to read the binlog events from socket - `BinlogFromSocket`, or file - `BinlogFromFile`. Based on prev impl of `EventBase` and the same old binlog parsers. It fully keeps BC with old version. Fixed `./check-mysql-binlog` to test new impl.
2. Introduced `BinlogEventsDispatcher`, it reads the event from the source `IBinlog` and sends it to currently attached `IBinlog` instances.
3. Introduced `BinlogClient`, which is used to group a list of `BinlogEventsDispatcher` by MySQL binlog connection which is defined by `user:password@host:port`. All dispatchers with the same binlog position should be merged to one.
4. Introduced `BinlogClientFactory`, which is a singleton and it is used to track all binlogs created over the instance.
5. Introduced `use_binlog_client` setting to `MaterializedMySQL`, which forces to reuse a `BinlogClient` if it already exists in `BinlogClientCatalog` or create new one. By default, it is disabled.
6. Introduced `max_bytes_in_binlog_queue` setting to define the limit of bytes in binlog's queue of events. If bytes in the queue increases this limit, `BinlogEventsDispatcher` will stop reading new events from source `IBinlog` until the space for new events will be freed.
7. Introduced `max_milliseconds_to_wait_in_binlog_queue` setting to define max ms to wait when the max bytes exceeded.
7. Introduced `max_milliseconds_to_wait_in_binlog_queue` setting to define max ms to wait when the max bytes exceeded.
8. Introduced `max_bytes_in_binlog_dispatcher_buffer` setting to define max bytes in the binlog dispatcher's buffer before it is flushed to attached binlogs.
9. Introduced `max_flush_milliseconds_in_binlog_dispatcher` setting to define max milliseconds in the binlog dispatcher's buffer to wait before it is flushed to attached binlogs.
10. Introduced `system.mysql_binlogs` system table, which shows a list of active binlogs.
11. Introduced `UnparsedRowsEvent` and `MYSQL_UNPARSED_ROWS_EVENT`, which defines that an event is not parsed and should be explicitly parsed later.
12. Fixed bug when not possible to apply DDL since syntax error or unsupported SQL.

@larspars is the author of following:
`GTIDSets::contains()`
`ReplicationHelper`
`shouldReconnectOnException()`
2024-01-03 15:26:09 +01:00
..
antlr Update README.md 2022-11-02 23:38:03 +03:00
backupview Fix parsing virtual hosted S3 URI 2023-12-07 12:32:32 +01:00
changelog Automatically correct some mistakes in the changelog 2023-03-27 14:48:05 +02:00
check-marks Prefix overridden add_executable() command with "clickhouse_" 2022-07-11 19:36:18 +02:00
check-mysql-binlog MaterializedMySQL: Introduce MySQL Binlog Client 2024-01-03 15:26:09 +01:00
check-style Remove function 2023-12-30 14:52:54 +01:00
checksum-for-compressed-block Support getHexUIntLowercase() with CityHash_v1_0_2::uint128 parameter. 2023-06-29 15:29:37 +02:00
clickhouse-diagnostics Update readme 2023-11-02 16:04:54 +01:00
compressor fix 2023-01-25 16:06:40 +01:00
corrector_utf8 Prefix overridden add_executable() command with "clickhouse_" 2022-07-11 19:36:18 +02:00
debug_remote_fs_performance Resubmit prefetches 2023-02-08 21:26:24 +01:00
durability-test
grpc-client Use pregenerated gRPC protocol pb2 files to fix test flakyness. 2023-09-26 17:28:19 +02:00
kafka
keeper-bench Better text_log with ErrnoException 2023-12-15 19:27:56 +01:00
keeper-data-dumper Fix tests 2023-08-23 09:00:57 +00:00
keeper-overload Automatic style fix 2023-03-24 15:04:05 +00:00
list-licenses use env to find bash 2023-09-13 18:57:11 +02:00
list-versions Update version_date.tsv and changelogs after v23.12.1.1368-stable 2023-12-28 10:32:09 +00:00
memcpy-bench Fix FreeBSD build 2023-05-07 06:55:24 +00:00
postprocess-traces
prepare-time-trace Fix shellcheck for time-trace 2023-11-20 15:15:37 +01:00
report Install only "programs" directory during build 2023-02-15 11:49:19 +01:00
s3tools Update black version, run it for the repository 2023-03-24 11:54:38 +01:00
security-generator Slightly improve the generator readbility 2023-11-24 20:23:11 +01:00
self-extracting-executable Print info while decompressing 2023-11-06 09:29:02 +00:00
test_history apply black formatter 2023-03-23 15:33:23 +00:00
tests-visualizer Fix tests visualizer 2023-04-29 23:48:45 +02:00
trace-visualizer Fix typos in some js code and ignore some typos 2022-08-07 19:59:39 +00:00
zero_copy
zookeeper-cli Move LineReader/ReplxxLineReader out from base 2022-12-27 14:23:51 +01:00
zookeeper-dump-tree Prefix overridden add_executable() command with "clickhouse_" 2022-07-11 19:36:18 +02:00
zookeeper-remove-by-list Prefix overridden add_executable() command with "clickhouse_" 2022-07-11 19:36:18 +02:00
async_loader_graph Rename system.async_loader into system.asynchronous_loader 2023-12-12 16:55:27 +00:00
c++expr fix root CMakeLists.txt search 2022-05-26 04:39:02 +02:00
clickhouse-docker
CMakeLists.txt Merge branch 'master' into remove-useless-install 2023-11-20 01:12:08 +01:00
data-lakes-importer.py Hudi tests 2023-03-21 12:51:14 +01:00