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