MySQL 8.4.2
Source Code Documentation
rpl_binlog_sender.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef DEFINED_RPL_BINLOG_SENDER
25#define DEFINED_RPL_BINLOG_SENDER
26
27#include <string.h>
28#include <sys/types.h>
29#include <chrono>
30
31#include "my_inttypes.h"
32#include "my_io.h"
34#include "mysql_com.h"
35#include "mysqld_error.h" // ER_*
36#include "sql/binlog.h" // LOG_INFO
37#include "sql/binlog_reader.h"
38#include "sql/rpl_gtid.h"
39#include "sql/sql_error.h" // Diagnostics_area
40
41class String;
42class THD;
43
44/**
45 The major logic of dump thread is implemented in this class. It sends
46 required binlog events to clients according to their requests.
47*/
49 class Event_allocator;
53
54 public:
55 Binlog_sender(THD *thd, const char *start_file, my_off_t start_pos,
56 Gtid_set *exclude_gtids, uint32 flag);
57
58 ~Binlog_sender() = default;
59
60 /**
61 It checks the dump request and sends events to the client until it finish
62 all events(for mysqlbinlog) or encounters an error.
63 */
64 void run();
65
66 /**
67 Sets the value of the previously processed event.
68
69 @param type The last processed event type.
70 */
73 }
74
75 private:
76 /**
77 Checks whether thread should continue awaiting new events
78 @param log_pos Last processed (sent) event id
79 */
80 bool stop_waiting_for_update(my_off_t log_pos) const;
81
84
85 /* Requested start binlog file and position */
86 const char *m_start_file;
88
89 /*
90 For COM_BINLOG_DUMP_GTID, It may include a GTID set. All events in the set
91 should not be sent to the client.
92 */
97
98 /* The binlog file it is reading */
100
103 std::chrono::nanoseconds m_heartbeat_period;
104 std::chrono::nanoseconds m_last_event_sent_ts;
105 /*
106 For mysqlbinlog(server_id is 0), it will stop immediately without waiting
107 if it already reads all events.
108 */
110
113 const char *m_errmsg;
115 /*
116 The position of the event it reads most recently is stored. So it can report
117 the exact position after where an error happens.
118
119 m_last_file will point to m_info.log_file_name, if it is same to
120 m_info.log_file_name. Otherwise the file name is copied to m_last_file_buf
121 and m_last_file will point to it.
122 */
124 const char *m_last_file;
126
127 /*
128 Needed to be able to evaluate if buffer needs to be resized (shrunk).
129 */
131
132 /*
133 * The size of the buffer next time we shrink it.
134 * This variable is updated once every time we shrink or grow the buffer.
135 */
137
138 /*
139 Max size of the buffer is 4GB (UINT_MAX32). It is UINT_MAX32 since the
140 threshold is set to (@c Log_event::read_log_event):
141
142 max(max_allowed_packet,
143 binlog_row_event_max_size + MAX_LOG_EVENT_HEADER)
144
145 - binlog_row_event_max_size is defined as an unsigned long,
146 thence in theory row events can be bigger than UINT_MAX32.
147
148 - max_allowed_packet is set to mysql::binlog::event::max_log_event_size
149 which is in turn defined as 1GB (i.e., 1024*1024*1024). (@c
150 Binlog_sender::init()).
151
152 Therefore, anything bigger than UINT_MAX32 is not loadable into the
153 packet, thus we set the limit to 4GB (which is the value for UINT_MAX32,
154 @c PACKET_MAXIMUM_SIZE).
155
156 */
158
159 /*
160 * After these consecutive times using less than half of the buffer
161 * the buffer is shrunk.
162 */
164
165 /**
166 * The minimum size of the buffer.
167 */
169
170 /**
171 * How much to grow the buffer each time we need to accommodate more bytes
172 * than it currently can hold.
173 */
174 const static float PACKET_GROW_FACTOR;
175
176 /**
177 * The dual of PACKET_GROW_FACTOR. How much to shrink the buffer each time
178 * it is deemed to being underused.
179 */
180 const static float PACKET_SHRINK_FACTOR;
181
183 /*
184 It is true if any plugin requires to observe the transmission for each
185 event. And HOOKs(reserve_header, before_send and after_send) are called when
186 transmitting each event. Otherwise, it is false and HOOKs are not called.
187 */
189
190 /* It is true if transmit_start hook is called. If the hook is not called
191 * it will be false.
192 */
194 /**
195 Type of the previously processed event.
196 */
198 /*
199 It initializes the context, checks if the dump request is valid and
200 if binlog status is correct.
201 */
202 void init();
203 void cleanup();
205 void init_checksum_alg();
206 /** Check if the requested binlog file and position are valid */
207 int check_start_file();
208 /** Transform read error numbers to error messages. */
210
211 /**
212 It dumps a binlog file. Events are read and sent one by one. If it need
213 to wait for new events, it will wait after already reading all events in
214 the active log file.
215
216 @param[in] reader File_reader of binlog will be sent
217 @param[in] start_pos Position requested by the slave's IO thread.
218 Only the events after the position are sent.
219
220 @return It returns 0 if succeeds, otherwise 1 is returned.
221 */
222 int send_binlog(File_reader &reader, my_off_t start_pos);
223
224 /**
225 It sends some events in a binlog file to the client.
226
227 @param[in] reader File_reader of binlog will be sent
228 @param[in] end_pos Only the events before end_pos are sent
229
230 @return It returns 0 if succeeds, otherwise 1 is returned.
231 */
232 int send_events(File_reader &reader, my_off_t end_pos);
233
234 /**
235 It gets the end position of the binlog file.
236
237 @param[in] reader File_reader of binlog will be checked
238 @returns Pair :
239 - Binlog end position - will be set to the end position
240 of the reading binlog file. If this is an inactive file,
241 it will be set to 0.
242 - Status code - 0 (success), 1 (end execution)
243 @note Function is responsible for flushing the net buffer, flushes before
244 waiting and before returning 1 which means end of the execution
245 (normal/error)
246 */
247 std::pair<my_off_t, int> get_binlog_end_pos(File_reader &reader);
248
249 /**
250 It checks if a binlog file has Previous_gtid_log_event
251
252 @param[in] reader File_reader of binlog will be checked
253 @param[out] found Found Previous_gtid_log_event or not
254
255 @return It returns 0 if succeeds, otherwise 1 is returned.
256 */
257 int has_previous_gtid_log_event(File_reader &reader, bool *found);
258
259 /**
260 It sends a faked rotate event which does not exist physically in any
261 binlog to the slave. It contains the name of the binlog we are going to
262 send to the slave.
263
264 Faked rotate event is required in a few cases, so slave can know which
265 binlog the following events are from.
266
267 - The binlog file slave requested is Empty. E.g.
268 "CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE='', SOURCE_LOG_POS=4", etc.
269
270 - The position slave requested is exactly the end of a binlog file.
271
272 - Previous binlog file does not include a rotate event.
273 It happens when server is shutdown and restarted.
274
275 - The previous binary log was GTID-free (does not contain a
276 Previous_gtids_log_event) and the slave is connecting using
277 the GTID protocol.
278
279 @param[in] next_log_file The name of the binlog file will be sent after
280 the rotate event.
281 @param[in] log_pos The start position of the binlog file.
282
283 @return It returns 0 if succeeds, otherwise 1 is returned.
284 */
285 int fake_rotate_event(const char *next_log_file, my_off_t log_pos);
286
287 /**
288 When starting to dump a binlog file, Format_description_log_event
289 is read and sent first. If the requested position is after
290 Format_description_log_event, log_pos field in the first
291 Format_description_log_event has to be set to 0. So the slave
292 will not increment its master's binlog position.
293
294 @param[in] reader File_reader of the binlog will be dumpped
295 @param[in] start_pos Position requested by the slave's IO thread.
296 Only the events after the position are sent.
297
298 @return It returns 0 if succeeds, otherwise 1 is returned.
299 */
300 int send_format_description_event(File_reader &reader, my_off_t start_pos);
301 /**
302 It sends a heartbeat to the client.
303
304 @param[in] log_pos The log position that events before it are sent.
305
306 @return It returns 0 if succeeds, otherwise 1 is returned.
307 */
309 /**
310 It sends a heartbeat to the client, for the cases when the
311 flag USE_HEARTBEAT_EVENT_V2 is set.
312 @param[in] log_pos The log position that events before it are sent.
313
314 @return It returns 0 if succeeds, otherwise 1 is returned.
315 */
317 /**
318 Checks if the heartbeat_version flag is set or not, and call the correct
319 send_heartbeat_method accordingly.
320
321 @param[in] log_pos The log position that events before it are sent.
322
323 @return It returns 0 if succeeds, otherwise 1 is returned.
324 */
325 int send_heartbeat_event(my_off_t log_pos);
326 /**
327 It reads an event from binlog file. this function can set event_ptr either
328 a valid buffer pointer or nullptr. nullptr means it arrives at the end of
329 the binlog file if no error happens.
330
331 @param[in] reader File_reader of the binlog file.
332 @param[out] event_ptr The buffer used to store the event.
333 @param[out] event_len Length of the event.
334
335 @retval 0 Succeed
336 @retval 1 Fail
337 */
338 int read_event(File_reader &reader, uchar **event_ptr, uint32 *event_len);
339 /**
340 Check if it is allowed to send this event type.
341
342 The following are disallowed:
343 - GTID_MODE=ON and type==ANONYMOUS_GTID_LOG_EVENT
344 - AUTO_POSITION=1 and type==ANONYMOUS_GTID_LOG_EVENT
345 - GTID_MODE=OFF and type==GTID_LOG_EVENT
346
347 @param type The event type.
348 @param log_file The binary log file (used in error messages).
349 @param log_pos The binary log position (used in error messages).
350
351 @retval true The event is not allowed. In this case, this function
352 calls set_fatal_error().
353 @retval false The event is allowed.
354 */
356 const char *log_file, my_off_t log_pos);
357 /**
358 It checks if the event is in m_exclude_gtid.
359
360 Clients may request to exclude some GTIDs. The events include in the GTID
361 groups will be skipped. We call below events sequence as a goup,
362 Gtid_log_event
363 BEGIN
364 ...
365 COMMIT or ROLLBACK
366
367 or
368 Gtid_log_event
369 DDL statement
370
371 @param[in] event_ptr Buffer of the event
372 @param[in] in_exclude_group If it is in a exclude group
373
374 @return It returns true if it should be skipped, otherwise false is turned.
375 */
376 bool skip_event(const uchar *event_ptr, bool in_exclude_group);
377
378 void calc_event_checksum(uchar *event_ptr, size_t event_len);
379 int flush_net();
380 int send_packet();
382 int before_send_hook(const char *log_file, my_off_t log_pos);
383 int after_send_hook(const char *log_file, my_off_t log_pos);
384 /*
385 Reset the thread transmit packet buffer for event sending.
386
387 This function reserves the bytes for event transmission, and
388 should be called before storing the event data to the packet buffer.
389
390 @param[in] flags The flag used in reset_transmit hook.
391 @param[in] event_len If the caller already knows the event length, then
392 it can pass this value so that reset_transmit_packet
393 already reallocates the buffer if needed. Otherwise,
394 if event_len is 0, then the caller needs to extend
395 the buffer itself.
396 */
397 int reset_transmit_packet(ushort flags, size_t event_len = 0);
398
399 /**
400 It waits until receiving an update_cond signal. It will send heartbeat
401 periodically if m_heartbeat_period is set.
402
403 @param[in] log_pos The end position of the last event it already sent.
404 It is required by heartbeat events.
405
406 @return It returns 0 if succeeds, otherwise 1 is returned.
407 */
408 int wait_new_events(my_off_t log_pos);
409 int wait_with_heartbeat(my_off_t log_pos);
410 int wait_without_heartbeat(my_off_t log_pos);
411
412#ifndef NDEBUG
413 /* It is used to count the events that have been sent. */
415 /*
416 It aborts dump thread with an error if m_event_count exceeds
417 max_binlog_dump_events.
418 */
419 int check_event_count();
420#endif
421
422 inline bool has_error() { return m_errno != 0; }
423 inline void set_error(int errorno, const char *errmsg) {
424 snprintf(m_errmsg_buf, sizeof(m_errmsg_buf), "%.*s", MYSQL_ERRMSG_SIZE - 1,
425 errmsg);
427 m_errno = errorno;
428 }
429
430 inline void set_unknown_error(const char *errmsg) {
431 set_error(ER_UNKNOWN_ERROR, errmsg);
432 }
433
434 inline void set_fatal_error(const char *errmsg) {
435 set_error(ER_SOURCE_FATAL_ERROR_READING_BINLOG, errmsg);
436 }
437
438 inline bool is_fatal_error() {
439 return m_errno == ER_SOURCE_FATAL_ERROR_READING_BINLOG;
440 }
441
442 inline bool event_checksum_on() {
443 return m_event_checksum_alg >
447 }
448
449 inline void set_last_pos(my_off_t log_pos) {
451 m_last_pos = log_pos;
452 }
453
454 inline void set_last_file(const char *log_file) {
455 strcpy(m_last_file_buf, log_file);
457 }
458
459 /**
460 * This function SHALL grow the buffer of the packet if needed.
461 *
462 * If the buffer used for the packet is large enough to accommodate
463 * the requested extra bytes, then this function does not do anything.
464 *
465 * On the other hand, if the requested size is bigger than the available
466 * free bytes in the buffer, the buffer is extended by a constant factor
467 * (@c PACKET_GROW_FACTOR).
468 *
469 * @param extra_size The size in bytes that the caller wants to add to the
470 * buffer.
471 * @return true if an error occurred, false otherwise.
472 */
473 bool grow_packet(size_t extra_size);
474
475 /**
476 * This function SHALL shrink the size of the buffer used.
477 *
478 * If less than half of the buffer was used in the last N
479 * (@c PACKET_SHRINK_COUNTER_THRESHOLD) consecutive times this function
480 * was called, then the buffer gets shrunk by a constant factor
481 * (@c PACKET_SHRINK_FACTOR).
482 *
483 * The buffer is never shrunk less than a minimum size (@c PACKET_MIN_SIZE).
484 */
485 bool shrink_packet();
486
487 /**
488 Helper function to recalculate a new size for the growing buffer.
489
490 @param current_size The baseline (for instance, the current buffer size).
491 @param min_size The resulting buffer size, needs to be at least as large
492 as this parameter states.
493 @return The new buffer size, or 0 in the case of an error.
494 */
495 size_t calc_grow_buffer_size(size_t current_size, size_t min_size);
496
497 /**
498 Helper function to recalculate the new size for the m_new_shrink_size.
499
500 @param current_size The baseline (for instance, the current buffer size).
501 */
502 void calc_shrink_buffer_size(size_t current_size);
503};
504
505#endif // DEFINED_RPL_BINLOG_SENDER
Contains the classes representing events occurring in the replication stream.
It owns an allocator, a byte stream, an event_data stream and an event object stream.
Definition: binlog_reader.h:295
Binlog_event_data_istream fetches byte data from Basic_istream and divides them into event_data chunk...
Definition: binlog_reader.h:58
It reads event_data from an event_data stream and deserialize them to event object.
Definition: binlog_reader.h:180
Binlog input file.
Definition: binlog_istream.h:241
Error_type
Possible errors which happens when reading an event.
Definition: binlog_istream.h:42
Binlog_sender reads events one by one.
Definition: rpl_binlog_sender.cc:221
The major logic of dump thread is implemented in this class.
Definition: rpl_binlog_sender.h:48
void set_error(int errorno, const char *errmsg)
Definition: rpl_binlog_sender.h:423
int send_packet_and_flush()
Definition: rpl_binlog_sender.cc:1372
THD * m_thd
Definition: rpl_binlog_sender.h:82
bool m_observe_transmission
Definition: rpl_binlog_sender.h:188
void set_prev_event_type(mysql::binlog::event::Log_event_type type)
Sets the value of the previously processed event.
Definition: rpl_binlog_sender.h:71
int after_send_hook(const char *log_file, my_off_t log_pos)
Definition: rpl_binlog_sender.cc:1387
String & m_packet
Definition: rpl_binlog_sender.h:83
my_off_t m_last_pos
Definition: rpl_binlog_sender.h:125
Binlog_sender(THD *thd, const char *start_file, my_off_t start_pos, Gtid_set *exclude_gtids, uint32 flag)
Definition: rpl_binlog_sender.cc:241
int send_heartbeat_event(my_off_t log_pos)
Checks if the heartbeat_version flag is set or not, and call the correct send_heartbeat_method accord...
Definition: rpl_binlog_sender.cc:566
int check_event_count()
Definition: rpl_binlog_sender.cc:1410
bool m_wait_new_events
Definition: rpl_binlog_sender.h:109
bool has_error()
Definition: rpl_binlog_sender.h:422
bool stop_waiting_for_update(my_off_t log_pos) const
Checks whether thread should continue awaiting new events.
Definition: rpl_binlog_sender.cc:804
static const float PACKET_SHRINK_FACTOR
The dual of PACKET_GROW_FACTOR.
Definition: rpl_binlog_sender.h:180
ushort m_half_buffer_size_req_counter
Definition: rpl_binlog_sender.h:130
uint32 m_flag
Definition: rpl_binlog_sender.h:182
void init()
Definition: rpl_binlog_sender.cc:264
char m_last_file_buf[FN_REFLEN]
Definition: rpl_binlog_sender.h:123
static const uint32 PACKET_MIN_SIZE
The minimum size of the buffer.
Definition: rpl_binlog_sender.h:168
bool m_gtid_clear_fd_created_flag
Definition: rpl_binlog_sender.h:96
const char * m_errmsg
Definition: rpl_binlog_sender.h:113
const char * m_start_file
Definition: rpl_binlog_sender.h:86
void run()
It checks the dump request and sends events to the client until it finish all events(for mysqlbinlog)...
Definition: rpl_binlog_sender.cc:386
std::chrono::nanoseconds m_last_event_sent_ts
Definition: rpl_binlog_sender.h:104
bool grow_packet(size_t extra_size)
This function SHALL grow the buffer of the packet if needed.
Definition: rpl_binlog_sender.cc:1420
void set_last_pos(my_off_t log_pos)
Definition: rpl_binlog_sender.h:449
mysql::binlog::event::enum_binlog_checksum_alg m_event_checksum_alg
Definition: rpl_binlog_sender.h:101
int m_errno
Definition: rpl_binlog_sender.h:114
static const float PACKET_GROW_FACTOR
How much to grow the buffer each time we need to accommodate more bytes than it currently can hold.
Definition: rpl_binlog_sender.h:174
int send_heartbeat_event_v2(my_off_t log_pos)
It sends a heartbeat to the client, for the cases when the flag USE_HEARTBEAT_EVENT_V2 is set.
Definition: rpl_binlog_sender.cc:1294
int send_events(File_reader &reader, my_off_t end_pos)
It sends some events in a binlog file to the client.
Definition: rpl_binlog_sender.cc:572
int read_event(File_reader &reader, uchar **event_ptr, uint32 *event_len)
It reads an event from binlog file.
Definition: rpl_binlog_sender.cc:1224
std::chrono::nanoseconds m_heartbeat_period
Definition: rpl_binlog_sender.h:103
Diagnostics_area m_diag_area
Definition: rpl_binlog_sender.h:111
const char * log_read_error_msg(Binlog_read_error::Error_type error)
Transform read error numbers to error messages.
Definition: rpl_binlog_sender.cc:1204
int flush_net()
Definition: rpl_binlog_sender.cc:1341
int reset_transmit_packet(ushort flags, size_t event_len=0)
Definition: rpl_binlog_sender.cc:1071
bool shrink_packet()
This function SHALL shrink the size of the buffer used.
Definition: rpl_binlog_sender.cc:1453
bool m_transmit_started
Definition: rpl_binlog_sender.h:193
void cleanup()
Definition: rpl_binlog_sender.cc:366
LOG_INFO m_linfo
Definition: rpl_binlog_sender.h:99
bool m_check_previous_gtid_event
Definition: rpl_binlog_sender.h:95
static const ushort PACKET_SHRINK_COUNTER_THRESHOLD
Definition: rpl_binlog_sender.h:163
mysql::binlog::event::enum_binlog_checksum_alg m_slave_checksum_alg
Definition: rpl_binlog_sender.h:102
int before_send_hook(const char *log_file, my_off_t log_pos)
Definition: rpl_binlog_sender.cc:1376
bool m_using_gtid_protocol
Definition: rpl_binlog_sender.h:94
Gtid_set * m_exclude_gtid
Definition: rpl_binlog_sender.h:93
Basic_binlog_file_reader< Binlog_ifile, Binlog_event_data_istream, Binlog_event_object_istream, Event_allocator > File_reader
Definition: rpl_binlog_sender.h:49
int send_packet()
Definition: rpl_binlog_sender.cc:1350
void set_fatal_error(const char *errmsg)
Definition: rpl_binlog_sender.h:434
void init_heartbeat_period()
Definition: rpl_binlog_sender.cc:849
char m_errmsg_buf[MYSQL_ERRMSG_SIZE]
Definition: rpl_binlog_sender.h:112
bool event_checksum_on()
Definition: rpl_binlog_sender.h:442
void calc_shrink_buffer_size(size_t current_size)
Helper function to recalculate the new size for the m_new_shrink_size.
Definition: rpl_binlog_sender.cc:1523
int check_start_file()
Check if the requested binlog file and position are valid.
Definition: rpl_binlog_sender.cc:864
bool skip_event(const uchar *event_ptr, bool in_exclude_group)
It checks if the event is in m_exclude_gtid.
Definition: rpl_binlog_sender.cc:749
int send_binlog(File_reader &reader, my_off_t start_pos)
It dumps a binlog file.
Definition: rpl_binlog_sender.cc:497
bool is_fatal_error()
Definition: rpl_binlog_sender.h:438
void init_checksum_alg()
Definition: rpl_binlog_sender.cc:999
int send_format_description_event(File_reader &reader, my_off_t start_pos)
When starting to dump a binlog file, Format_description_log_event is read and sent first.
Definition: rpl_binlog_sender.cc:1098
void set_unknown_error(const char *errmsg)
Definition: rpl_binlog_sender.h:430
int wait_without_heartbeat(my_off_t log_pos)
Definition: rpl_binlog_sender.cc:841
void calc_event_checksum(uchar *event_ptr, size_t event_len)
Definition: rpl_binlog_sender.cc:1064
void set_last_file(const char *log_file)
Definition: rpl_binlog_sender.h:454
static const uint32 PACKET_MAX_SIZE
Definition: rpl_binlog_sender.h:157
size_t m_new_shrink_size
Definition: rpl_binlog_sender.h:136
int wait_with_heartbeat(my_off_t log_pos)
Definition: rpl_binlog_sender.cc:812
mysql::binlog::event::Log_event_type m_prev_event_type
Type of the previously processed event.
Definition: rpl_binlog_sender.h:197
int has_previous_gtid_log_event(File_reader &reader, bool *found)
It checks if a binlog file has Previous_gtid_log_event.
Definition: rpl_binlog_sender.cc:1187
const char * m_last_file
Definition: rpl_binlog_sender.h:124
int send_heartbeat_event_v1(my_off_t log_pos)
It sends a heartbeat to the client.
Definition: rpl_binlog_sender.cc:1268
int fake_rotate_event(const char *next_log_file, my_off_t log_pos)
It sends a faked rotate event which does not exist physically in any binlog to the slave.
Definition: rpl_binlog_sender.cc:1029
std::pair< my_off_t, int > get_binlog_end_pos(File_reader &reader)
It gets the end position of the binlog file.
Definition: rpl_binlog_sender.cc:537
int m_event_count
Definition: rpl_binlog_sender.h:414
my_off_t m_start_pos
Definition: rpl_binlog_sender.h:87
~Binlog_sender()=default
size_t calc_grow_buffer_size(size_t current_size, size_t min_size)
Helper function to recalculate a new size for the growing buffer.
Definition: rpl_binlog_sender.cc:1500
int wait_new_events(my_off_t log_pos)
It waits until receiving an update_cond signal.
Definition: rpl_binlog_sender.cc:771
bool check_event_type(mysql::binlog::event::Log_event_type type, const char *log_file, my_off_t log_pos)
Check if it is allowed to send this event type.
Definition: rpl_binlog_sender.cc:690
Stores status of the currently executed statement.
Definition: sql_error.h:269
Represents a set of GTIDs.
Definition: rpl_gtid.h:1556
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
Some integer typedefs for easier portability.
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
Common definition between mysql server & client.
#define MYSQL_ERRMSG_SIZE
Max length of a error message.
Definition: mysql_com.h:881
Logfile log_file
Definition: mysqltest.cc:271
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:286
enum_binlog_checksum_alg
Enumeration spcifying checksum algorithm used to encode a binary log event.
Definition: binlog_event.h:462
@ BINLOG_CHECKSUM_ALG_OFF
Events are without checksum though its generator is checksum-capable New Master (NM).
Definition: binlog_event.h:467
@ BINLOG_CHECKSUM_ALG_ENUM_END
the cut line: valid alg range is [1, 0x7f]
Definition: binlog_event.h:471
required string type
Definition: replication_group_member_actions.proto:34
Definition: binlog.h:115
char log_file_name[FN_REFLEN]
Definition: binlog.h:116