MySQL 8.0.32
Source Code Documentation
rpl_binlog_sender.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2022, 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
31#include "my_inttypes.h"
32#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 MAX_MAX_ALLOWED_PACKET which is in
148 turn defined as 1GB (i.e., 1024*1024*1024). (@c Binlog_sender::init()).
149
150 Therefore, anything bigger than UINT_MAX32 is not loadable into the
151 packet, thus we set the limit to 4GB (which is the value for UINT_MAX32,
152 @c PACKET_MAXIMUM_SIZE).
153
154 */
156
157 /*
158 * After these consecutive times using less than half of the buffer
159 * the buffer is shrunk.
160 */
162
163 /**
164 * The minimum size of the buffer.
165 */
167
168 /**
169 * How much to grow the buffer each time we need to accommodate more bytes
170 * than it currently can hold.
171 */
172 const static float PACKET_GROW_FACTOR;
173
174 /**
175 * The dual of PACKET_GROW_FACTOR. How much to shrink the buffer each time
176 * it is deemed to being underused.
177 */
178 const static float PACKET_SHRINK_FACTOR;
179
181 /*
182 It is true if any plugin requires to observe the transmission for each
183 event. And HOOKs(reserve_header, before_send and after_send) are called when
184 transmitting each event. Otherwise, it is false and HOOKs are not called.
185 */
187
188 /* It is true if transmit_start hook is called. If the hook is not called
189 * it will be false.
190 */
192 /**
193 Type of the previously processed event.
194 */
196 /*
197 It initializes the context, checks if the dump request is valid and
198 if binlog status is correct.
199 */
200 void init();
201 void cleanup();
203 void init_checksum_alg();
204 /** Check if the requested binlog file and position are valid */
205 int check_start_file();
206 /** Transform read error numbers to error messages. */
208
209 /**
210 It dumps a binlog file. Events are read and sent one by one. If it need
211 to wait for new events, it will wait after already reading all events in
212 the active log file.
213
214 @param[in] reader File_reader of binlog will be sent
215 @param[in] start_pos Position requested by the slave's IO thread.
216 Only the events after the position are sent.
217
218 @return It returns 0 if succeeds, otherwise 1 is returned.
219 */
220 int send_binlog(File_reader &reader, my_off_t start_pos);
221
222 /**
223 It sends some events in a binlog file to the client.
224
225 @param[in] reader File_reader of binlog will be sent
226 @param[in] end_pos Only the events before end_pos are sent
227
228 @return It returns 0 if succeeds, otherwise 1 is returned.
229 */
230 int send_events(File_reader &reader, my_off_t end_pos);
231
232 /**
233 It gets the end position of the binlog file.
234
235 @param[in] reader File_reader of binlog will be checked
236 @returns Pair :
237 - Binlog end position - will be set to the end position
238 of the reading binlog file. If this is an inactive file,
239 it will be set to 0.
240 - Status code - 0 (success), 1 (end execution)
241 @note Function is responsible for flushing the net buffer, flushes before
242 waiting and before returning 1 which means end of the execution
243 (normal/error)
244 */
245 std::pair<my_off_t, int> get_binlog_end_pos(File_reader &reader);
246
247 /**
248 It checks if a binlog file has Previous_gtid_log_event
249
250 @param[in] reader File_reader of binlog will be checked
251 @param[out] found Found Previous_gtid_log_event or not
252
253 @return It returns 0 if succeeds, otherwise 1 is returned.
254 */
255 int has_previous_gtid_log_event(File_reader &reader, bool *found);
256
257 /**
258 It sends a faked rotate event which does not exist physically in any
259 binlog to the slave. It contains the name of the binlog we are going to
260 send to the slave.
261
262 Faked rotate event is required in a few cases, so slave can know which
263 binlog the following events are from.
264
265 - The binlog file slave requested is Empty. E.g.
266 "CHANGE MASTER TO MASTER_LOG_FILE='', MASTER_LOG_POS=4", etc.
267
268 - The position slave requested is exactly the end of a binlog file.
269
270 - Previous binlog file does not include a rotate event.
271 It happens when server is shutdown and restarted.
272
273 - The previous binary log was GTID-free (does not contain a
274 Previous_gtids_log_event) and the slave is connecting using
275 the GTID protocol.
276
277 @param[in] next_log_file The name of the binlog file will be sent after
278 the rotate event.
279 @param[in] log_pos The start position of the binlog file.
280
281 @return It returns 0 if succeeds, otherwise 1 is returned.
282 */
283 int fake_rotate_event(const char *next_log_file, my_off_t log_pos);
284
285 /**
286 When starting to dump a binlog file, Format_description_log_event
287 is read and sent first. If the requested position is after
288 Format_description_log_event, log_pos field in the first
289 Format_description_log_event has to be set to 0. So the slave
290 will not increment its master's binlog position.
291
292 @param[in] reader File_reader of the binlog will be dumpped
293 @param[in] start_pos Position requested by the slave's IO thread.
294 Only the events after the position are sent.
295
296 @return It returns 0 if succeeds, otherwise 1 is returned.
297 */
298 int send_format_description_event(File_reader &reader, my_off_t start_pos);
299 /**
300 It sends a heartbeat to the client.
301
302 @param[in] log_pos The log position that events before it are sent.
303
304 @return It returns 0 if succeeds, otherwise 1 is returned.
305 */
307 /**
308 It sends a heartbeat to the client, for the cases when the
309 flag USE_HEARTBEAT_EVENT_V2 is set.
310 @param[in] log_pos The log position that events before it are sent.
311
312 @return It returns 0 if succeeds, otherwise 1 is returned.
313 */
315 /**
316 Checks if the heartbeat_version flag is set or not, and call the correct
317 send_heartbeat_method accordingly.
318
319 @param[in] log_pos The log position that events before it are sent.
320
321 @return It returns 0 if succeeds, otherwise 1 is returned.
322 */
323 int send_heartbeat_event(my_off_t log_pos);
324 /**
325 It reads an event from binlog file. this function can set event_ptr either
326 a valid buffer pointer or nullptr. nullptr means it arrives at the end of
327 the binlog file if no error happens.
328
329 @param[in] reader File_reader of the binlog file.
330 @param[out] event_ptr The buffer used to store the event.
331 @param[out] event_len Length of the event.
332
333 @retval 0 Succeed
334 @retval 1 Fail
335 */
336 int read_event(File_reader &reader, uchar **event_ptr, uint32 *event_len);
337 /**
338 Check if it is allowed to send this event type.
339
340 The following are disallowed:
341 - GTID_MODE=ON and type==ANONYMOUS_GTID_LOG_EVENT
342 - AUTO_POSITION=1 and type==ANONYMOUS_GTID_LOG_EVENT
343 - GTID_MODE=OFF and type==GTID_LOG_EVENT
344
345 @param type The event type.
346 @param log_file The binary log file (used in error messages).
347 @param log_pos The binary log position (used in error messages).
348
349 @retval true The event is not allowed. In this case, this function
350 calls set_fatal_error().
351 @retval false The event is allowed.
352 */
354 my_off_t log_pos);
355 /**
356 It checks if the event is in m_exclude_gtid.
357
358 Clients may request to exclude some GTIDs. The events include in the GTID
359 groups will be skipped. We call below events sequence as a goup,
360 Gtid_log_event
361 BEGIN
362 ...
363 COMMIT or ROLLBACK
364
365 or
366 Gtid_log_event
367 DDL statement
368
369 @param[in] event_ptr Buffer of the event
370 @param[in] in_exclude_group If it is in a exclude group
371
372 @return It returns true if it should be skipped, otherwise false is turned.
373 */
374 bool skip_event(const uchar *event_ptr, bool in_exclude_group);
375
376 void calc_event_checksum(uchar *event_ptr, size_t event_len);
377 int flush_net();
378 int send_packet();
380 int before_send_hook(const char *log_file, my_off_t log_pos);
381 int after_send_hook(const char *log_file, my_off_t log_pos);
382 /*
383 Reset the thread transmit packet buffer for event sending.
384
385 This function reserves the bytes for event transmission, and
386 should be called before storing the event data to the packet buffer.
387
388 @param[in] flags The flag used in reset_transmit hook.
389 @param[in] event_len If the caller already knows the event length, then
390 it can pass this value so that reset_transmit_packet
391 already reallocates the buffer if needed. Otherwise,
392 if event_len is 0, then the caller needs to extend
393 the buffer itself.
394 */
395 int reset_transmit_packet(ushort flags, size_t event_len = 0);
396
397 /**
398 It waits until receiving an update_cond signal. It will send heartbeat
399 periodically if m_heartbeat_period is set.
400
401 @param[in] log_pos The end position of the last event it already sent.
402 It is required by heartbeat events.
403
404 @return It returns 0 if succeeds, otherwise 1 is returned.
405 */
406 int wait_new_events(my_off_t log_pos);
407 int wait_with_heartbeat(my_off_t log_pos);
408 int wait_without_heartbeat(my_off_t log_pos);
409
410#ifndef NDEBUG
411 /* It is used to count the events that have been sent. */
413 /*
414 It aborts dump thread with an error if m_event_count exceeds
415 max_binlog_dump_events.
416 */
417 int check_event_count();
418#endif
419
420 inline bool has_error() { return m_errno != 0; }
421 inline void set_error(int errorno, const char *errmsg) {
422 snprintf(m_errmsg_buf, sizeof(m_errmsg_buf), "%.*s", MYSQL_ERRMSG_SIZE - 1,
423 errmsg);
425 m_errno = errorno;
426 }
427
428 inline void set_unknown_error(const char *errmsg) {
429 set_error(ER_UNKNOWN_ERROR, errmsg);
430 }
431
432 inline void set_fatal_error(const char *errmsg) {
433 set_error(ER_MASTER_FATAL_ERROR_READING_BINLOG, errmsg);
434 }
435
436 inline bool is_fatal_error() {
437 return m_errno == ER_MASTER_FATAL_ERROR_READING_BINLOG;
438 }
439
440 inline bool event_checksum_on() {
443 }
444
445 inline void set_last_pos(my_off_t log_pos) {
447 m_last_pos = log_pos;
448 }
449
450 inline void set_last_file(const char *log_file) {
451 strcpy(m_last_file_buf, log_file);
453 }
454
455 /**
456 * This function SHALL grow the buffer of the packet if needed.
457 *
458 * If the buffer used for the packet is large enough to accommodate
459 * the requested extra bytes, then this function does not do anything.
460 *
461 * On the other hand, if the requested size is bigger than the available
462 * free bytes in the buffer, the buffer is extended by a constant factor
463 * (@c PACKET_GROW_FACTOR).
464 *
465 * @param extra_size The size in bytes that the caller wants to add to the
466 * buffer.
467 * @return true if an error occurred, false otherwise.
468 */
469 bool grow_packet(size_t extra_size);
470
471 /**
472 * This function SHALL shrink the size of the buffer used.
473 *
474 * If less than half of the buffer was used in the last N
475 * (@c PACKET_SHRINK_COUNTER_THRESHOLD) consecutive times this function
476 * was called, then the buffer gets shrunk by a constant factor
477 * (@c PACKET_SHRINK_FACTOR).
478 *
479 * The buffer is never shrunk less than a minimum size (@c PACKET_MIN_SIZE).
480 */
481 bool shrink_packet();
482
483 /**
484 Helper function to recalculate a new size for the growing buffer.
485
486 @param current_size The baseline (for instance, the current buffer size).
487 @param min_size The resulting buffer size, needs to be at least as large
488 as this parameter states.
489 @return The new buffer size, or 0 in the case of an error.
490 */
491 size_t calc_grow_buffer_size(size_t current_size, size_t min_size);
492
493 /**
494 Helper function to recalculate the new size for the m_new_shrink_size.
495
496 @param current_size The baseline (for instance, the current buffer size).
497 */
498 void calc_shrink_buffer_size(size_t current_size);
499};
500
501#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:246
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:177
Binlog input file.
Definition: binlog_istream.h:236
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:213
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:421
int send_packet_and_flush()
Definition: rpl_binlog_sender.cc:1359
THD * m_thd
Definition: rpl_binlog_sender.h:81
bool m_observe_transmission
Definition: rpl_binlog_sender.h:186
int after_send_hook(const char *log_file, my_off_t log_pos)
Definition: rpl_binlog_sender.cc:1374
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:233
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:560
int check_event_count()
Definition: rpl_binlog_sender.cc:1397
bool m_wait_new_events
Definition: rpl_binlog_sender.h:108
bool has_error()
Definition: rpl_binlog_sender.h:420
bool stop_waiting_for_update(my_off_t log_pos) const
Checks whether thread should continue awaiting new events.
Definition: rpl_binlog_sender.cc:794
static const float PACKET_SHRINK_FACTOR
The dual of PACKET_GROW_FACTOR.
Definition: rpl_binlog_sender.h:178
ushort m_half_buffer_size_req_counter
Definition: rpl_binlog_sender.h:129
uint32 m_flag
Definition: rpl_binlog_sender.h:180
void init()
Definition: rpl_binlog_sender.cc:256
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:166
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:381
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:1407
void set_last_pos(my_off_t log_pos)
Definition: rpl_binlog_sender.h:445
binary_log::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:172
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:1283
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:566
int read_event(File_reader &reader, uchar **event_ptr, uint32 *event_len)
It reads an event from binlog file.
Definition: rpl_binlog_sender.cc:1213
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:1193
int flush_net()
Definition: rpl_binlog_sender.cc:1328
int reset_transmit_packet(ushort flags, size_t event_len=0)
Definition: rpl_binlog_sender.cc:1064
bool shrink_packet()
This function SHALL shrink the size of the buffer used.
Definition: rpl_binlog_sender.cc:1440
bool m_transmit_started
Definition: rpl_binlog_sender.h:191
void cleanup()
Definition: rpl_binlog_sender.cc:359
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:161
binary_log::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:1363
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:1337
void set_fatal_error(const char *errmsg)
Definition: rpl_binlog_sender.h:432
void init_heartbeat_period()
Definition: rpl_binlog_sender.cc:839
void set_prev_event_type(binary_log::Log_event_type type)
Sets the value of the previously processed event.
Definition: rpl_binlog_sender.h:70
char m_errmsg_buf[MYSQL_ERRMSG_SIZE]
Definition: rpl_binlog_sender.h:111
bool event_checksum_on()
Definition: rpl_binlog_sender.h:440
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:1510
int check_start_file()
Check if the requested binlog file and position are valid.
Definition: rpl_binlog_sender.cc:854
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:740
int send_binlog(File_reader &reader, my_off_t start_pos)
It dumps a binlog file.
Definition: rpl_binlog_sender.cc:491
bool is_fatal_error()
Definition: rpl_binlog_sender.h:436
void init_checksum_alg()
Definition: rpl_binlog_sender.cc:993
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:1091
void set_unknown_error(const char *errmsg)
Definition: rpl_binlog_sender.h:428
int wait_without_heartbeat(my_off_t log_pos)
Definition: rpl_binlog_sender.cc:831
void calc_event_checksum(uchar *event_ptr, size_t event_len)
Definition: rpl_binlog_sender.cc:1057
void set_last_file(const char *log_file)
Definition: rpl_binlog_sender.h:450
static const uint32 PACKET_MAX_SIZE
Definition: rpl_binlog_sender.h:155
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:802
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:1177
const char * m_last_file
Definition: rpl_binlog_sender.h:123
binary_log::Log_event_type m_prev_event_type
Type of the previously processed event.
Definition: rpl_binlog_sender.h:195
int send_heartbeat_event_v1(my_off_t log_pos)
It sends a heartbeat to the client.
Definition: rpl_binlog_sender.cc:1257
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:1022
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:531
int m_event_count
Definition: rpl_binlog_sender.h:412
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:1487
int wait_new_events(my_off_t log_pos)
It waits until receiving an update_cond signal.
Definition: rpl_binlog_sender.cc:761
bool check_event_type(binary_log::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:682
Stores status of the currently executed statement.
Definition: sql_error.h:268
Represents a set of GTIDs.
Definition: rpl_gtid.h:1454
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:33
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:879
Logfile log_file
Definition: mysqltest.cc:262
enum_binlog_checksum_alg
Enumeration spcifying checksum algorithm used to encode a binary log event.
Definition: binlog_event.h:420
@ BINLOG_CHECKSUM_ALG_ENUM_END
the cut line: valid alg range is [1, 0x7f]
Definition: binlog_event.h:429
@ BINLOG_CHECKSUM_ALG_OFF
Events are without checksum though its generator is checksum-capable New Master (NM).
Definition: binlog_event.h:425
Log_event_type
Enumeration type for the different types of log events.
Definition: binlog_event.h:274
required string type
Definition: replication_group_member_actions.proto:33
Definition: binlog.h:117
char log_file_name[FN_REFLEN]
Definition: binlog.h:118