MySQL 8.4.5
Source Code Documentation
binlog.h
Go to the documentation of this file.
1#ifndef BINLOG_H_INCLUDED
2/* Copyright (c) 2010, 2025, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
24
25#define BINLOG_H_INCLUDED
26
27#include <string.h>
28#include <sys/types.h>
29#include <time.h>
30#include <atomic>
31#include <string_view>
32#include <utility>
33
34#include "my_dbug.h"
35#include "my_inttypes.h"
36#include "my_io.h"
37#include "my_sharedlib.h"
38#include "my_sys.h"
39#include "mysql/binlog/event/binlog_event.h" // enum_binlog_checksum_alg
49#include "mysql_com.h" // Item_result
50#include "sql/binlog_reader.h" // Binlog_file_reader
53#include "sql/tc_log.h" // TC_LOG
54#include "sql/transaction_info.h" // Transaction_ctx
55#include "thr_mutex.h"
56
59class Gtid_set;
60class Ha_trx_info;
61class Log_event;
62class Master_info;
63class Relay_log_info;
64class Rows_log_event;
65class Tsid_map;
66class THD;
67class Transaction_boundary_parser;
69class user_var_entry;
71
72struct Gtid;
73
75
76/*
77 Maximum unique log filename extension.
78 Note: setting to 0x7FFFFFFF due to atol windows
79 overflow/truncate.
80 */
81#define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF
82
83/*
84 Maximum allowed unique log filename extension for
85 RESET BINARY LOGS AND GTIDS command - 2 Billion
86 */
87#define MAX_ALLOWED_FN_EXT_RESET_BIN_LOGS 2000000000
88
91 char *value;
92 ulong length;
96};
97
98/* log info errors */
99#define LOG_INFO_EOF -1
100#define LOG_INFO_IO -2
101#define LOG_INFO_INVALID -3
102#define LOG_INFO_SEEK -4
103#define LOG_INFO_MEM -6
104#define LOG_INFO_FATAL -7
105#define LOG_INFO_IN_USE -8
106#define LOG_INFO_EMFILE -9
107#define LOG_INFO_BACKUP_LOCK -10
108#define LOG_INFO_NOT_IN_USE -11
109
110/* bitmap to MYSQL_BIN_LOG::close() */
111#define LOG_CLOSE_INDEX 1
112#define LOG_CLOSE_TO_BE_OPENED 2
113#define LOG_CLOSE_STOP_EVENT 4
114
115struct LOG_INFO {
119 bool fatal; // if the purge happens to give us a negative offset
120 int entry_index; // used in purge_logs(), calculatd in find_log_pos().
126 pos(0),
127 fatal(false),
128 entry_index(0),
130 thread_id(0) {
131 memset(log_file_name, 0, FN_REFLEN);
132 }
133};
134
135/*
136 TODO use mmap instead of IO_CACHE for binlog
137 (mmap+fsync is two times faster than write+fsync)
138*/
139class MYSQL_BIN_LOG : public TC_LOG {
140 public:
141 class Binlog_ofile;
142
143 private:
145
146 /* LOCK_log is inited by init_pthread_objects() */
148 char *name;
150 char db[NAME_LEN + 1];
153
154 /** Instrumentation key to use for file io in @c log_file */
156 /** The instrumentation key to use for @ LOCK_log. */
158 /** The instrumentation key to use for @ LOCK_index. */
160 /** The instrumentation key to use for @ LOCK_binlog_end_pos. */
162 /** The PFS instrumentation key for @ LOCK_commit_queue. */
164 /** The PFS instrumentation key for @ LOCK_after_commit_queue. */
166 /** The PFS instrumentation key for @ LOCK_done. */
168 /** The PFS instrumentation key for @ LOCK_flush_queue. */
170 /** The PFS instrumentation key for @ LOCK_sync_queue. */
172 /** The PFS instrumentation key for @ LOCK_wait_for_group_turn. */
174 /** The PFS instrumentation key for @ COND_done. */
176 /** The PFS instrumentation key for @ COND_flush_queue. */
178 /** The instrumentation key to use for @ LOCK_commit. */
180 /** The instrumentation key to use for @ LOCK_after_commit. */
182 /** The instrumentation key to use for @ LOCK_sync. */
184 /** The instrumentation key to use for @ LOCK_xids. */
186 /** The instrumentation key to use for @ m_key_LOCK_log_info. */
188 /** The instrumentation key to use for @ update_cond. */
190 /** The instrumentation key to use for @ prep_xids_cond. */
192 /** The PFS instrumentation key for @ COND_wait_for_group_turn. */
194 /** The instrumentation key to use for opening the log file. */
196 /** The instrumentation key to use for opening the log index file. */
198 /** The instrumentation key to use for opening a log cache file. */
200 /** The instrumentation key to use for opening a log index cache file. */
202
203 /* POSIX thread objects are inited by init_pthread_objects() */
211
212 std::atomic<my_off_t> atomic_binlog_end_pos;
216 /*
217 crash_safe_index_file is temp file used for guaranteeing
218 index file crash safe when master server restarts.
219 */
222 /*
223 purge_file is a temp file used in purge_logs so that the index file
224 can be updated before deleting files from disk, yielding better crash
225 recovery. It is created on demand the first time purge_logs is called
226 and then reused for subsequent calls. It is cleaned up in cleanup().
227 */
230 /*
231 The max size before rotation (usable only if log_type == LOG_BIN: binary
232 logs and relay logs).
233 For a binlog, max_size should be max_binlog_size.
234 For a relay log, it should be max_relay_log_size if this is non-zero,
235 max_binlog_size otherwise.
236 max_size is set in init(), and dynamically changed (when one does SET
237 GLOBAL MAX_BINLOG_SIZE|MAX_RELAY_LOG_SIZE) by fix_max_binlog_size and
238 fix_max_relay_log_size).
239 */
240 ulong max_size;
241
242 // current file sequence number for load data infile binary logging
244
245 /* pointer to the sync period variable, for binlog this will be
246 sync_binlog_period, for relay log this will be
247 sync_relay_log_period
248 */
251
253 std::atomic<int32> m_atomic_prep_xids{0};
254
255 /**
256 Increment the prepared XID counter.
257 */
258 void inc_prep_xids(THD *thd);
259
260 /**
261 Decrement the prepared XID counter.
262
263 Signal m_prep_xids_cond if the counter reaches zero.
264 */
265 void dec_prep_xids(THD *thd);
266
268
269 inline uint get_sync_period() { return *sync_period_ptr; }
270
271 public:
272 /**
273 Wait until the number of prepared XIDs are zero.
274 */
275 void wait_for_prep_xids();
276
277 /*
278 This is used to start writing to a new log file. The difference from
279 new_file() is locking. new_file_without_locking() does not acquire
280 LOCK_log.
281 */
283 Format_description_log_event *extra_description_event);
284
285 /**
286 Checks whether binlog caches are disabled (binlog does not cache data) or
287 empty in case binloggging is enabled in the current call to this function.
288 This function may be safely called in case binlogging is disabled.
289 @retval true binlog local caches are empty or disabled and binlogging is
290 enabled
291 @retval false binlog local caches are enabled and contain data or binlogging
292 is disabled
293 */
295
296 private:
297 int new_file_impl(bool need_lock,
298 Format_description_log_event *extra_description_event);
299
300 bool open(PSI_file_key log_file_key, const char *log_name,
301 const char *new_name, uint32 new_index_number);
302 bool init_and_set_log_file_name(const char *log_name, const char *new_name,
303 uint32 new_index_number);
304 int generate_new_name(char *new_name, const char *log_name,
305 uint32 new_index_number = 0);
306 /**
307 * Read binary log stream header and Format_desc event from
308 * binlog_file_reader. Check for LOG_EVENT_BINLOG_IN_USE_F flag.
309 * @param[in] binlog_file_reader a Binlog_file_reader
310 * @return true - LOG_EVENT_BINLOG_IN_USE_F is set
311 * false - LOG_EVENT_BINLOG_IN_USE_F is not set or an error occurred
312 * while reading log events
313 */
314 bool read_binlog_in_use_flag(Binlog_file_reader &binlog_file_reader);
315
316 protected:
317 /**
318 @brief Notifies waiting threads that binary log has been updated
319 */
320 void signal_update();
321
322 public:
323 const char *generate_name(const char *log_name, const char *suffix,
324 char *buff);
325 bool is_open() const { return atomic_log_state != LOG_CLOSED; }
326
327 /// @brief Obtains the list of logs from the index file
328 /// @return List of log filenames
329 std::pair<std::list<std::string>, mysql::utils::Error> get_filename_list();
330
331 /* This is relay log */
333
334 uint8 checksum_alg_reset; // to contain a new value when binlog is rotated
335 /*
336 Holds the last seen in Relay-Log FD's checksum alg value.
337 The initial value comes from the slave's local FD that heads
338 the very first Relay-Log file. In the following the value may change
339 with each received master's FD_m.
340 Besides to be used in verification events that IO thread receives
341 (except the 1st fake Rotate, see @c Master_info:: checksum_alg_before_fd),
342 the value specifies if/how to compute checksum for slave's local events
343 and the first fake Rotate (R_f^1) coming from the master.
344 R_f^1 needs logging checksum-compatibly with the RL's heading FD_s.
345
346 Legends for the checksum related comments:
347
348 FD - Format-Description event,
349 R - Rotate event
350 R_f - The fake Rotate event
351 E - An arbitrary event
352
353 The underscore indexes for any event
354 `_s' - Indicates the event is generated by the Replica
355 `_m' - By the Source
356
357 Two special underscore indexes of FD:
358 FD_q - Format Description event for queuing (relay-logging)
359 FD_e - Format Description event for executing (relay-logging)
360
361 Upper indexes:
362 E^n - n:th event is a sequence
363
364 RL - Relay Log
365 (A) - checksum algorithm descriptor value
366 FD.(A) - the value of (A) in FD
367 */
369
370 MYSQL_BIN_LOG(uint *sync_period, bool relay_log = false);
371 ~MYSQL_BIN_LOG() override;
372
374 PSI_mutex_key key_LOCK_index, PSI_mutex_key key_LOCK_commit,
375 PSI_mutex_key key_LOCK_commit_queue, PSI_mutex_key key_LOCK_after_commit,
376 PSI_mutex_key key_LOCK_after_commit_queue, PSI_mutex_key key_LOCK_done,
377 PSI_mutex_key key_LOCK_flush_queue, PSI_mutex_key key_LOCK_log,
378 PSI_mutex_key key_LOCK_binlog_end_pos, PSI_mutex_key key_LOCK_sync,
379 PSI_mutex_key key_LOCK_sync_queue, PSI_mutex_key key_LOCK_xids,
380 PSI_mutex_key key_LOCK_log_info,
381 PSI_mutex_key key_LOCK_wait_for_group_turn, PSI_cond_key key_COND_done,
382 PSI_cond_key key_COND_flush_queue, PSI_cond_key key_update_cond,
383 PSI_cond_key key_prep_xids_cond,
384 PSI_cond_key key_COND_wait_for_group_turn, PSI_file_key key_file_log,
385 PSI_file_key key_file_log_index, PSI_file_key key_file_log_cache,
386 PSI_file_key key_file_log_index_cache) {
387 m_key_COND_done = key_COND_done;
388 m_key_COND_flush_queue = key_COND_flush_queue;
389
390 m_key_LOCK_commit_queue = key_LOCK_commit_queue;
391 m_key_LOCK_after_commit_queue = key_LOCK_after_commit_queue;
392 m_key_LOCK_done = key_LOCK_done;
393 m_key_LOCK_flush_queue = key_LOCK_flush_queue;
394 m_key_LOCK_sync_queue = key_LOCK_sync_queue;
395
396 m_key_LOCK_index = key_LOCK_index;
397 m_key_LOCK_log = key_LOCK_log;
398 m_key_LOCK_binlog_end_pos = key_LOCK_binlog_end_pos;
399 m_key_LOCK_commit = key_LOCK_commit;
400 m_key_LOCK_after_commit = key_LOCK_after_commit;
401 m_key_LOCK_sync = key_LOCK_sync;
402 m_key_LOCK_xids = key_LOCK_xids;
403 m_key_LOCK_log_info = key_LOCK_log_info;
404 m_key_update_cond = key_update_cond;
405 m_key_prep_xids_cond = key_prep_xids_cond;
406 m_key_file_log = key_file_log;
407 m_key_file_log_index = key_file_log_index;
408 m_key_file_log_cache = key_file_log_cache;
409 m_key_file_log_index_cache = key_file_log_index_cache;
410
411 m_key_LOCK_wait_for_group_turn = key_LOCK_wait_for_group_turn;
412 m_key_COND_wait_for_group_turn = key_COND_wait_for_group_turn;
413 }
414
415 public:
416 /** Manage the MTS dependency tracking */
418
419 /**
420 Find the oldest binary log referenced by the index file
421
422 @param[out] binlog_file_name the file name of oldest log found
423 @param[out] errmsg the error message outputted, which is left untouched
424 if the function returns false
425 @return false on success, true on error.
426 */
427 bool find_first_log(std::string &binlog_file_name, std::string &errmsg);
428
429 /**
430 Find the oldest binary log that contains any GTID that
431 is not in the given gtid set.
432
433 @param[out] binlog_file_name the file name of oldest binary log found
434 @param[in] gtid_set the given gtid set
435 @param[out] first_gtid the first GTID information from the binary log
436 file returned at binlog_file_name
437 @param[out] errmsg the error message outputted, which is left untouched
438 if the function returns false
439 @return false on success, true on error.
440 */
441 bool find_first_log_not_in_gtid_set(char *binlog_file_name,
442 const Gtid_set *gtid_set,
443 Gtid *first_gtid, std::string &errmsg);
444
445 /**
446 Reads the set of all GTIDs in the binary/relay log, and the set
447 of all lost GTIDs in the binary log, and stores each set in
448 respective argument.
449
450 @param all_gtids Will be filled with all GTIDs in this binary/relay
451 log.
452 @param lost_gtids Will be filled with all GTIDs in the
453 Previous_gtids_log_event of the first binary log that has a
454 Previous_gtids_log_event. This is requested to binary logs but not
455 to relay logs.
456 @param verify_checksum If true, checksums will be checked.
457 @param need_lock If true, LOCK_log, LOCK_index, and
458 global_tsid_lock->wrlock are acquired; otherwise they are asserted
459 to be taken already.
460 @param [out] trx_parser This will be used to return the actual
461 relaylog transaction parser state because of the possibility
462 of partial transactions.
463 @param [out] partial_trx If a transaction was left incomplete
464 on the relaylog, its GTID information should be returned to be
465 used in the case of the rest of the transaction be added to the
466 relaylog.
467 @param is_server_starting True if the server is starting.
468 @return false on success, true on error.
469 */
470 bool init_gtid_sets(
471 Gtid_set *all_gtids, Gtid_set *lost_gtids, bool verify_checksum,
472 bool need_lock,
474 Gtid_monitoring_info *partial_trx, bool is_server_starting = false);
475
476 void set_previous_gtid_set_relaylog(Gtid_set *previous_gtid_set_param) {
477 assert(is_relay_log);
478 previous_gtid_set_relaylog = previous_gtid_set_param;
479 }
480 /**
481 If the thread owns a GTID, this function generates an empty
482 transaction and releases ownership of the GTID.
483
484 - If the binary log is disabled for this thread, the GTID is
485 inserted directly into the mysql.gtid_executed table and the
486 GTID is included in @@global.gtid_executed. (This only happens
487 for DDL, since DML will save the GTID into table and release
488 ownership inside ha_commit_trans.)
489
490 - If the binary log is enabled for this thread, an empty
491 transaction consisting of GTID, BEGIN, COMMIT is written to the
492 binary log, the GTID is included in @@global.gtid_executed, and
493 the GTID is added to the mysql.gtid_executed table on the next
494 binlog rotation.
495
496 This function must be called by any committing statement (COMMIT,
497 implicitly committing statements, or Xid_log_event), after the
498 statement has completed execution, regardless of whether the
499 statement updated the database.
500
501 This logic ensures that an empty transaction is generated for the
502 following cases:
503
504 - Explicit empty transaction:
505 SET GTID_NEXT = 'UUID:NUMBER'; BEGIN; COMMIT;
506
507 - Transaction or DDL that gets completely filtered out in the
508 slave thread.
509
510 @param thd The committing thread
511
512 @retval 0 Success
513 @retval nonzero Error
514 */
515 int gtid_end_transaction(THD *thd);
516 /**
517 Re-encrypt previous existent binary/relay logs as below.
518 Starting from the next to last entry on the index file, iterating
519 down to the first one:
520 - If the file is encrypted, re-encrypt it. Otherwise, skip it.
521 - If failed to open the file, report an error.
522
523 @retval False Success
524 @retval True Error
525 */
526 bool reencrypt_logs();
527
528 private:
529 std::atomic<enum_log_state> atomic_log_state{LOG_CLOSED};
530
531 /* The previous gtid set in relay log. */
533
534 int open(const char *opt_name) override { return open_binlog(opt_name); }
535
536 /**
537 Enter a stage of the ordered commit procedure.
538
539 Entering is stage is done by:
540
541 - Atomically entering a queue of THD objects (which is just one for
542 the first phase).
543
544 - If the queue was empty, the thread is the leader for that stage
545 and it should process the entire queue for that stage.
546
547 - If the queue was not empty, the thread is a follower and can go
548 waiting for the commit to finish.
549
550 The function will lock the stage mutex if the calling thread was designated
551 leader for the phase.
552
553 @param[in] thd Session structure
554 @param[in] stage The stage to enter
555 @param[in] queue Thread queue for the stage
556 @param[in] leave_mutex Mutex that will be released when changing stage
557 @param[in] enter_mutex Mutex that will be taken when changing stage
558
559 @retval true In case this thread did not become leader, the function
560 returns true *after* the leader has completed the commit
561 on its behalf, so the thread should continue doing the
562 thread-local processing after the commit
563 (i.e. call finish_commit).
564
565 @retval false The thread is the leader for the stage and should do
566 the processing.
567 */
569 mysql_mutex_t *leave_mutex, mysql_mutex_t *enter_mutex);
570 std::pair<int, my_off_t> flush_thread_caches(THD *thd);
571 int flush_cache_to_file(my_off_t *flush_end_pos);
572 int finish_commit(THD *thd);
573 std::pair<bool, bool> sync_binlog_file(bool force);
575 void process_after_commit_stage_queue(THD *thd, THD *first);
576
577 /**
578 Set thread variables used while flushing a transaction.
579
580 @param[in] thd thread whose variables need to be set
581 @param[in] all This is @c true if this is a real transaction commit, and
582 @c false otherwise.
583 @param[in] skip_commit
584 This is @c true if the call to @c ha_commit_low should
585 be skipped (it is handled by the caller somehow) and @c
586 false otherwise (the normal case).
587 */
588 void init_thd_variables(THD *thd, bool all, bool skip_commit);
589
590 /**
591 Fetch and empty BINLOG_FLUSH_STAGE and COMMIT_ORDER_FLUSH_STAGE flush queues
592 and flush transactions to the disk, and unblock threads executing slave
593 preserve commit order.
594
595 @param[in] check_and_skip_flush_logs
596 if false then flush prepared records of transactions to the log
597 of storage engine.
598 if true then flush prepared records of transactions to the log
599 of storage engine only if COMMIT_ORDER_FLUSH_STAGE queue is
600 non-empty.
601
602 @return Pointer to the first session of the BINLOG_FLUSH_STAGE stage queue.
603 */
605 const bool check_and_skip_flush_logs = false);
606
607 /**
608 Execute the flush stage.
609
610 @param[out] total_bytes_var Pointer to variable that will be set to total
611 number of bytes flushed, or NULL.
612
613 @param[out] out_queue_var Pointer to the sessions queue in flush stage.
614
615 @return Error code on error, zero on success
616 */
617 int process_flush_stage_queue(my_off_t *total_bytes_var, THD **out_queue_var);
618
619 /**
620 Flush and commit the transaction.
621
622 This will execute an ordered flush and commit of all outstanding
623 transactions and is the main function for the binary log group
624 commit logic. The function performs the ordered commit in four stages.
625
626 Pre-condition: transactions should have called ha_prepare_low, using
627 HA_IGNORE_DURABILITY, before entering here.
628
629 Stage#0 implements replica-preserve-commit-order for applier threads that
630 write the binary log. i.e. it forces threads to enter the queue in the
631 correct commit order.
632
633 The stage#1 flushes the caches to the binary log and under
634 LOCK_log and marks all threads that were flushed as not pending.
635
636 The stage#2 syncs the binary log for all transactions in the group.
637
638 The stage#3 executes under LOCK_commit and commits all transactions in
639 order.
640
641 There are three queues of THD objects: one for each stage.
642 The Commit_order_manager maintains it own queue and its own order for the
643 commit. So Stage#0 doesn't maintain separate StageID.
644
645 When a transaction enters a stage, it adds itself to a queue. If the queue
646 was empty so that this becomes the first transaction in the queue, the
647 thread is the *leader* of the queue. Otherwise it is a *follower*. The
648 leader will do all work for all threads in the queue, and the followers
649 will wait until the last stage is finished.
650
651 Stage 0 (SLAVE COMMIT ORDER):
652 1. If replica-preserve-commit-order and is slave applier worker thread, then
653 waits until its turn to commit i.e. till it is on the top of the queue.
654 2. When it reaches top of the queue, it signals next worker in the commit
655 order queue to awake.
656
657 Stage 1 (FLUSH):
658 1. Sync the engines (ha_flush_logs), since they prepared using non-durable
659 settings (HA_IGNORE_DURABILITY).
660 2. Generate GTIDs for all transactions in the queue.
661 3. Write the session caches for all transactions in the queue to the binary
662 log.
663 4. Increment the counter of prepared XIDs.
664
665 Stage 2 (SYNC):
666 1. If it is time to sync, based on the sync_binlog option, sync the binlog.
667 2. If sync_binlog==1, signal dump threads that they can read up to the
668 position after the last transaction in the queue
669
670 Stage 3 (COMMIT):
671 This is performed by each thread separately, if binlog_order_commits=0.
672 Otherwise by the leader does it for all threads.
673 1. Call the after_sync hook.
674 2. update the max_committed counter in the dependency_tracker
675 3. call ha_commit_low
676 4. Call the after_commit hook
677 5. Update gtids
678 6. Decrement the counter of prepared transactions
679
680 If the binary log needs to be rotated, it is done after this. During
681 rotation, it takes a lock that prevents new commit groups from executing the
682 flush stage, and waits until the counter of prepared transactions becomes 0,
683 before it creates the new file.
684
685 @param[in] thd Session to commit transaction for
686 @param[in] all This is @c true if this is a real transaction commit, and
687 @c false otherwise.
688 @param[in] skip_commit
689 This is @c true if the call to @c ha_commit_low should
690 be skipped and @c false otherwise (the normal case).
691 */
692 int ordered_commit(THD *thd, bool all, bool skip_commit = false);
693 void handle_binlog_flush_or_sync_error(THD *thd, bool need_lock_log,
694 const char *message);
696 class Binlog_event_writer *writer);
698
699 public:
700 int open_binlog(const char *opt_name);
701 void close() override;
702 enum_result commit(THD *thd, bool all) override;
703 int rollback(THD *thd, bool all) override;
704 bool truncate_relaylog_file(Master_info *mi, my_off_t valid_pos);
705 int prepare(THD *thd, bool all) override;
706#if defined(MYSQL_SERVER)
707
710 bool is_transactional);
711
712#endif /* defined(MYSQL_SERVER) */
715 /// @brief Adds bytes written in the current relay log into the variable
716 /// handling the total number of bytes acquired by the replica. Resets the
717 /// counter of bytes written. If requested by caller,
718 /// acquires relay log space lock
719 /// @param rli Pointer to the applier metadata object
720 /// @param need_log_space_lock Information on whether to acquire the
721 /// lock protecting data responsible for keeping the relay log space at bay
722 void harvest_bytes_written(Relay_log_info *rli, bool need_log_space_lock);
723 void set_max_size(ulong max_size_arg);
724
725 void update_binlog_end_pos(bool need_lock = true);
726 void update_binlog_end_pos(const char *file, my_off_t pos);
727
728 /**
729 Wait until we get a signal that the binary log has been updated.
730
731 NOTES
732 @param[in] timeout a pointer to a timespec;
733 NULL means to wait w/o timeout.
734 @retval 0 if got signalled on update
735 @retval non-0 if wait timeout elapsed
736 @note
737 LOCK_binlog_end_pos must be owned before calling this function, may be
738 temporarily released while the thread is waiting and is reacquired before
739 returning from the function
740 */
741 int wait_for_update(const std::chrono::nanoseconds &timeout);
742
743 /**
744 Wait until we get a signal that the binary log has been updated.
745 @retval 0 success
746 @note
747 LOCK_binlog_end_pos must be owned before calling this function, may be
748 temporarily released while the thread is waiting and is reacquired before
749 returning from the function
750 */
751 int wait_for_update();
752
753 public:
755 void cleanup();
756 /**
757 Create a new binary log.
758 @param log_name Name of binlog
759 @param new_name Name of binlog, too. todo: what's the difference
760 between new_name and log_name?
761 @param max_size_arg The size at which this binlog will be rotated.
762 @param null_created_arg If false, and a Format_description_log_event
763 is written, then the Format_description_log_event will have the
764 timestamp 0. Otherwise, it the timestamp will be the time when the
765 event was written to the log.
766 @param need_lock_index If true, LOCK_index is acquired; otherwise
767 LOCK_index must be taken by the caller.
768 @param need_tsid_lock If true, the read lock on global_tsid_lock
769 will be acquired. Otherwise, the caller must hold the read lock
770 on global_tsid_lock.
771 @param extra_description_event The master's FDE to be written by the I/O
772 thread while creating a new relay log file. This should be NULL for
773 binary log files.
774 @param new_index_number The binary log file index number to start from
775 after the RESET BINARY LOGS AND GTIDS command is called.
776 */
777 bool open_binlog(const char *log_name, const char *new_name,
778 ulong max_size_arg, bool null_created_arg,
779 bool need_lock_index, bool need_tsid_lock,
780 Format_description_log_event *extra_description_event,
781 uint32 new_index_number = 0);
782 bool open_index_file(const char *index_file_name_arg, const char *log_name,
783 bool need_lock_index);
784 /* Use this to start writing a new log file */
785 int new_file(Format_description_log_event *extra_description_event);
786
787 bool write_event(Log_event *event_info);
788 bool write_cache(THD *thd, class binlog_cache_data *cache_data,
789 class Binlog_event_writer *writer);
790 /**
791 Assign automatic generated GTIDs for all commit group threads in the flush
792 stage having gtid_next.type == AUTOMATIC_GTID.
793
794 @param first_seen The first thread seen entering the flush stage.
795 @return Returns false if succeeds, otherwise true is returned.
796 */
798 bool write_transaction(THD *thd, binlog_cache_data *cache_data,
799 Binlog_event_writer *writer,
800 bool parallelization_barrier);
801
802 /**
803 Write a dml into statement cache and then flush it into binlog. It writes
804 Gtid_log_event and BEGIN, COMMIT automatically.
805
806 It is aimed to handle cases of "background" logging where a statement is
807 logged indirectly, like "TRUNCATE TABLE a_memory_table". So don't use it on
808 any normal statement.
809
810 @param[in] thd the THD object of current thread.
811 @param[in] stmt the DML statement.
812 @param[in] stmt_len the length of the DML statement.
813 @param[in] sql_command the type of SQL command.
814
815 @return Returns false if succeeds, otherwise true is returned.
816 */
817 bool write_stmt_directly(THD *thd, const char *stmt, size_t stmt_len,
818 enum enum_sql_command sql_command);
819
820 void report_cache_write_error(THD *thd, bool is_transactional);
821 bool check_write_error(const THD *thd);
824 void start_union_events(THD *thd, query_id_t query_id_param);
825 void stop_union_events(THD *thd);
826 bool is_query_in_union(THD *thd, query_id_t query_id_param);
827
828 bool write_buffer(const char *buf, uint len, Master_info *mi);
829 bool write_event(Log_event *ev, Master_info *mi);
830
831 /**
832 Logging XA commit/rollback of a prepared transaction.
833
834 It fills in the appropriate event in the statement cache whenever xid
835 state is marked with is_binlogged() flag that indicates the prepared
836 part of the transaction must've been logged.
837
838 About early returns from the function:
839 - ONE_PHASE option to XA-COMMIT is handled to skip writing XA-commit
840 event now.
841 - check is for the read-only XA that is not to be logged.
842
843 @param thd THD handle
844 @return error code, 0 success
845 */
846 int write_xa_to_cache(THD *thd);
847
848 ///
849 /// Write an incident and call commit.
850 ///
851 /// The incident is written by marking the transaction cache as having an
852 /// incident and then commit it to binlog. During commit, the flush stage will
853 /// write and Incident_log_event and preceding Gtid_log_event to give the
854 /// incident a proper GTID. The incident will also cause the binlog to be
855 /// rotated and check if some purge is applicable.
856 ///
857 /// @param[in] thd the THD object of current thread.
858 /// @param[in] incident_message A message describing the incident.
859 ///
860 /// @return Returns false if succeeds, otherwise true is returned.
861 ///
862 bool write_incident_commit(THD *thd, std::string_view incident_message);
863
864 private:
866
867 public:
868 /**
869 * Truncte log file and clear LOG_EVENT_BINLOG_IN_USE_F when update is set.
870 * @param[in] log_name name of the log file to be trunacted
871 * @param[in] valid_pos position at which to truncate the log file
872 * @param[in] binlog_size length of the log file before truncated
873 * @param[in] update should the LOG_EVENT_BINLOG_IN_USE_F flag be cleared
874 * true - set LOG_EVENT_BINLOG_IN_USE_F to 0
875 * false - do not modify LOG_EVENT_BINLOG_IN_USE_F flag
876 * @return true - sucess, false - failed
877 */
878 bool truncate_update_log_file(const char *log_name, my_off_t valid_pos,
879 my_off_t binlog_size, bool update);
880
881 void make_log_name(char *buf, const char *log_ident);
882 bool is_active(const char *log_file_name) const;
883
884 /// @brief Remove logs from index file, except files between 'start' and
885 /// 'last'
886 /// @details To make it crash safe, we copy the content of the index file
887 /// from index_file_start_offset recorded in log_info to a
888 /// crash safe index file first and then move the crash
889 /// safe index file to the index file.
890 /// @param start_log_info Metadata of the first log to be kept
891 /// in the index file
892 /// @param need_update_threads If we want to update the log coordinates
893 /// of all threads. False for relay logs,
894 /// true otherwise.
895 /// @param last_log_info Metadata of the last log to be kept in the index
896 /// file; nullptr means that all logs after start_log_info will be kept
897 /// @retval
898 /// 0 ok
899 /// @retval
900 /// LOG_INFO_IO Got IO error while reading/writing file
902 bool need_update_threads,
903 LOG_INFO *last_log_info = nullptr);
904 /// @brief Remove logs from index file except logs between first and last
905 /// @param first Filename of the first relay log to be kept in index file
906 /// @param last Filename of the last relay log to be kept in index file
907
908 /// @retval 0 OK
909 /// @retval LOG_INFO_IO Got IO error while reading/writing file
910 /// @retval LOG_INFO_EOF Could not find requested log file (first or last)
911 int remove_logs_outside_range_from_index(const std::string &first,
912 const std::string &last);
913 int rotate(bool force_rotate, bool *check_purge);
914
915 /**
916 @brief This function runs automatic purge if the conditions to meet
917 automatic purge are met. Such conditions are: log is open, instance is not
918 locked for backup and automatic purge is enabled.
919
920 If all conditions are met, purge is done according to the configuration
921 of the purge window.
922 */
923 void auto_purge();
924
925 /**
926 @brief This member function is to be called at server startup. It checks if
927 purge can be done and does if it can.
928 */
930 int rotate_and_purge(THD *thd, bool force_rotate);
931
932 bool flush();
933 /**
934 Flush binlog cache and synchronize to disk.
935
936 This function flushes events in binlog cache to binary log file,
937 it will do synchronizing according to the setting of system
938 variable 'sync_binlog'. If file is synchronized, @c synced will
939 be set to 1, otherwise 0.
940
941 @param[in] force if true, ignores the 'sync_binlog' and synchronizes the
942 file.
943
944 @retval 0 Success
945 @retval other Failure
946 */
947 bool flush_and_sync(const bool force = false);
948 int purge_logs(const char *to_log, bool included, bool need_lock_index,
949 bool need_update_threads, ulonglong *decrease_log_space,
950 bool auto_purge);
951 int purge_logs_before_date(time_t purge_time, bool auto_purge);
952 int set_crash_safe_index_file_name(const char *base_file_name);
955 int add_log_to_index(uchar *log_file_name, size_t name_len,
956 bool need_lock_index);
957 int move_crash_safe_index_file_to_index_file(bool need_lock_index);
958 int set_purge_index_file_name(const char *base_file_name);
963 int register_purge_index_entry(const char *entry);
964 int register_create_index_entry(const char *entry);
965 int purge_index_entry(THD *thd, ulonglong *decrease_log_space,
966 bool need_lock_index);
967 bool reset_logs(THD *thd, bool delete_only = false);
968 void close(uint exiting, bool need_lock_log, bool need_lock_index);
969
970 // iterating through the log index file
971 int find_log_pos(LOG_INFO *linfo, const char *log_name, bool need_lock_index);
972 int find_next_log(LOG_INFO *linfo, bool need_lock_index);
973 int find_next_relay_log(char log_name[FN_REFLEN + 1]);
974 int get_current_log(LOG_INFO *linfo, bool need_lock_log = true);
975 int raw_get_current_log(LOG_INFO *linfo);
976 uint next_file_id();
977 /**
978 Retrieves the contents of the index file associated with this log object
979 into an `std::list<std::string>` object. The order held by the index file is
980 kept.
981
982 @param need_lock_index whether or not the lock over the index file should be
983 acquired inside the function.
984
985 @return a pair: a function status code; a list of `std::string` objects with
986 the content of the log index file.
987 */
988 std::pair<int, std::list<std::string>> get_log_index(
989 bool need_lock_index = true);
990 inline char *get_index_fname() { return index_file_name; }
991 inline char *get_log_fname() { return log_file_name; }
992 const char *get_name() const { return name; }
993 inline mysql_mutex_t *get_log_lock() { return &LOCK_log; }
997 inline mysql_cond_t *get_log_cond() { return &update_cond; }
999
1002 inline IO_CACHE *get_index_file() { return &index_file; }
1003
1004 /**
1005 Function to report the missing GTIDs.
1006
1007 This function logs the missing transactions on master to its error log
1008 as a warning. If the missing GTIDs are too long to print in a message,
1009 it suggests the steps to extract the missing transactions.
1010
1011 This function also informs slave about the GTID set sent by the slave,
1012 transactions missing on the master and few suggestions to recover from
1013 the error. This message shall be wrapped by
1014 ER_SOURCE_FATAL_ERROR_READING_BINLOG on slave and will be logged as an
1015 error.
1016
1017 This function will be called from mysql_binlog_send() function.
1018
1019 @param slave_executed_gtid_set GTID set executed by slave
1020 @param errmsg Pointer to the error message
1021 */
1022 void report_missing_purged_gtids(const Gtid_set *slave_executed_gtid_set,
1023 std::string &errmsg);
1024
1025 /**
1026 Function to report the missing GTIDs.
1027
1028 This function logs the missing transactions on master to its error log
1029 as a warning. If the missing GTIDs are too long to print in a message,
1030 it suggests the steps to extract the missing transactions.
1031
1032 This function also informs slave about the GTID set sent by the slave,
1033 transactions missing on the master and few suggestions to recover from
1034 the error. This message shall be wrapped by
1035 ER_SOURCE_FATAL_ERROR_READING_BINLOG on slave and will be logged as an
1036 error.
1037
1038 This function will be called from find_first_log_not_in_gtid_set()
1039 function.
1040
1041 @param previous_gtid_set Previous GTID set found
1042 @param slave_executed_gtid_set GTID set executed by slave
1043 @param errmsg Pointer to the error message
1044 */
1045 void report_missing_gtids(const Gtid_set *previous_gtid_set,
1046 const Gtid_set *slave_executed_gtid_set,
1047 std::string &errmsg);
1049 /*
1050 It is called by the threads (e.g. dump thread, applier thread) which want
1051 to read hot log without LOCK_log protection.
1052 */
1055 return atomic_binlog_end_pos;
1056 }
1060
1061 /**
1062 Deep copy global_tsid_map and gtid_executed.
1063 Both operations are done under LOCK_commit and global_tsid_lock
1064 protection.
1065
1066 @param[out] tsid_map The Tsid_map to which global_tsid_map will
1067 be copied.
1068 @param[out] gtid_set The Gtid_set to which gtid_executed will
1069 be copied.
1070
1071 @return the operation status
1072 @retval 0 OK
1073 @retval !=0 Error
1074 */
1075 int get_gtid_executed(Tsid_map *tsid_map, Gtid_set *gtid_set);
1076
1077 public:
1078 /**
1079 Register LOG_INFO so that log_in_use and adjust_linfo_offsets can
1080 operate on all logs. Note that register_log_info, unregister_log_info,
1081 log_in_use, adjust_linfo_offsets are is used on global mysql_bin_log object.
1082 @param log_info pointer to LOG_INFO which is registred
1083 */
1085 /**
1086 Unregister LOG_INFO when it is no longer needed.
1087 @param log_info pointer to LOG_INFO which is registred
1088 */
1090 /**
1091 Check if any threads use log name.
1092 @note This method expects the LOCK_index to be taken so there are no
1093 concurrent edits against linfo objects being iterated
1094 @param log_name name of a log which is checked for usage
1095
1096 */
1097 int log_in_use(const char *log_name);
1098 /**
1099 Adjust the position pointer in the binary log file for all running replicas.
1100 SYNOPSIS
1101 adjust_linfo_offsets()
1102 purge_offset Number of bytes removed from start of log index file
1103 NOTES
1104 - This is called when doing a PURGE when we delete lines from the
1105 index log file. This method expects the LOCK_index to be taken so there
1106 are no concurrent edits against linfo objects being iterated. REQUIREMENTS
1107 - Before calling this function, we have to ensure that no threads are
1108 using any binary log file before purge_offset.
1109 TODO
1110 - Inform the replica threads that they should sync the position
1111 in the binary log file with flush_relay_log_info.
1112 Now they sync is done for next read.
1113 */
1114 void adjust_linfo_offsets(my_off_t purge_offset);
1115
1116 private:
1118 // Set of log info objects that are in usage and might prevent some other
1119 // operations from executing.
1120 std::set<LOG_INFO *> log_info_set;
1121};
1122
1127};
1128
1130
1131/**
1132 Check if the the transaction is empty.
1133
1134 @param thd The client thread that executed the current statement.
1135
1136 @retval true No changes found in any storage engine
1137 @retval false Otherwise.
1138
1139**/
1140bool is_transaction_empty(THD *thd);
1141/**
1142 Check if the transaction has no rw flag set for any of the storage engines.
1143
1144 @param thd The client thread that executed the current statement.
1145 @param trx_scope The transaction scope to look into.
1146
1147 @retval the number of engines which have actual changes.
1148 */
1150
1151/**
1152 Check if at least one of transacaction and statement binlog caches contains
1153 an empty transaction, other one is empty or contains an empty transaction,
1154 which has two binlog events "BEGIN" and "COMMIT".
1155
1156 @param thd The client thread that executed the current statement.
1157
1158 @retval true At least one of transacaction and statement binlog caches
1159 contains an empty transaction, other one is empty or
1160 contains an empty transaction.
1161 @retval false Otherwise.
1162*/
1164bool trans_has_updated_trans_table(const THD *thd);
1166bool ending_trans(THD *thd, const bool all);
1167bool ending_single_stmt_trans(THD *thd, const bool all);
1168bool trans_cannot_safely_rollback(const THD *thd);
1169bool stmt_cannot_safely_rollback(const THD *thd);
1170
1172
1173/**
1174 @brief Purges the binary log files up to the file name passed as
1175 a paramenter. Purge will not delete the file passed as
1176 an argument.
1177
1178 @param thd The session context.
1179 @param to_log Up to which log file to purge.
1180 @return true if there was an error.
1181 @return false if there was no error.
1182 */
1183bool purge_source_logs_to_file(THD *thd, const char *to_log);
1184
1185bool purge_source_logs_before_date(THD *thd, time_t purge_time);
1187bool mysql_show_binlog_events(THD *thd);
1188void check_binlog_cache_size(THD *thd);
1190bool binlog_enabled();
1191int query_error_code(const THD *thd, bool not_killed);
1192
1193extern const char *log_bin_index;
1194extern const char *log_bin_basename;
1195extern bool opt_binlog_order_commits;
1196extern ulong rpl_read_size;
1197/**
1198 Turns a relative log binary log path into a full path, based on the
1199 opt_bin_logname or opt_relay_logname. Also trims the cr-lf at the
1200 end of the full_path before return to avoid any server startup
1201 problem on windows.
1202
1203 @param from The log name we want to make into an absolute path.
1204 @param to The buffer where to put the results of the
1205 normalization.
1206 @param is_relay_log Switch that makes is used inside to choose which
1207 option (opt_bin_logname or opt_relay_logname) to
1208 use when calculating the base path.
1209
1210 @returns true if a problem occurs, false otherwise.
1211 */
1212
1213bool normalize_binlog_name(char *to, const char *from, bool is_relay_log);
1214
1215#endif /* BINLOG_H_INCLUDED */
int destroy(azio_stream *s)
Definition: azio.cc:371
int64 query_id_t
Definition: binlog.h:72
MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log
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
Byte container that provides a storage for serializing session binlog events.
Definition: binlog_ostream.h:174
Auxiliary class to copy serialized events to the binary log and correct some of the fields that are n...
Definition: binlog.cc:1415
StageID
Constants for queues for different stages.
Definition: rpl_commit_stage_manager.h:166
For binlog version 4.
Definition: log_event.h:1525
Stores information to monitor a transaction during the different replication stages.
Definition: rpl_gtid.h:1412
Represents a set of GTIDs.
Definition: rpl_gtid.h:1556
Container to hold and allow iteration over a set of Ha_trx_info objects.
Definition: transaction_info.h:503
Either statement transaction or normal transaction - related thread-specific storage engine data.
Definition: transaction_info.h:403
This is the abstract base class for binary log events.
Definition: log_event.h:538
Logical binlog file which wraps and hides the detail of lower layer storage implementation.
Definition: binlog.cc:380
Definition: binlog.h:139
mysql_mutex_t * get_binlog_end_pos_lock()
Definition: binlog.h:1057
const char * get_name() const
Definition: binlog.h:992
mysql_cond_t m_prep_xids_cond
Definition: binlog.h:252
mysql_mutex_t * get_commit_lock()
Definition: binlog.h:995
mysql_mutex_t LOCK_binlog_end_pos
Definition: binlog.h:208
std::atomic< my_off_t > atomic_binlog_end_pos
Definition: binlog.h:212
void unlock_binlog_end_pos()
Definition: binlog.h:1059
PSI_mutex_key m_key_LOCK_xids
The instrumentation key to use for @ LOCK_xids.
Definition: binlog.h:185
mysql_mutex_t LOCK_commit
Definition: binlog.h:205
char db[NAME_LEN+1]
Definition: binlog.h:150
void set_previous_gtid_set_relaylog(Gtid_set *previous_gtid_set_param)
Definition: binlog.h:476
IO_CACHE crash_safe_index_file
Definition: binlog.h:220
void reset_bytes_written()
Definition: binlog.h:714
void lock_binlog_end_pos()
Definition: binlog.h:1058
enum_log_state
Definition: binlog.h:144
@ LOG_OPENED
Definition: binlog.h:144
@ LOG_CLOSED
Definition: binlog.h:144
@ LOG_TO_BE_OPENED
Definition: binlog.h:144
mysql_mutex_t LOCK_index
Definition: binlog.h:204
PSI_mutex_key m_key_COND_done
The PFS instrumentation key for @ COND_done.
Definition: binlog.h:175
mysql_mutex_t LOCK_sync
Definition: binlog.h:207
PSI_mutex_key m_key_LOCK_after_commit
The instrumentation key to use for @ LOCK_after_commit.
Definition: binlog.h:181
PSI_mutex_key m_key_LOCK_commit_queue
The PFS instrumentation key for @ LOCK_commit_queue.
Definition: binlog.h:163
mysql_mutex_t LOCK_after_commit
Definition: binlog.h:206
Binlog_ofile * get_binlog_file()
Definition: binlog.h:998
mysql_mutex_t LOCK_log_info
Definition: binlog.h:1117
int open(const char *opt_name) override
Initialize and open the coordinator log.
Definition: binlog.h:534
mysql_mutex_t * get_log_lock()
Definition: binlog.h:993
bool is_open() const
Definition: binlog.h:325
IO_CACHE purge_index_file
Definition: binlog.h:228
PSI_cond_key m_key_prep_xids_cond
The instrumentation key to use for @ prep_xids_cond.
Definition: binlog.h:191
my_off_t get_binlog_end_pos() const
Definition: binlog.h:1053
void lock_index()
Definition: binlog.h:1000
PSI_mutex_key m_key_LOCK_flush_queue
The PFS instrumentation key for @ LOCK_flush_queue.
Definition: binlog.h:169
PSI_mutex_key m_key_LOCK_after_commit_queue
The PFS instrumentation key for @ LOCK_after_commit_queue.
Definition: binlog.h:165
int32 get_prep_xids()
Definition: binlog.h:267
std::atomic< enum_log_state > atomic_log_state
Definition: binlog.h:529
Gtid_set * previous_gtid_set_relaylog
Definition: binlog.h:532
PSI_cond_key m_key_update_cond
The instrumentation key to use for @ update_cond.
Definition: binlog.h:189
void set_psi_keys(PSI_mutex_key key_LOCK_index, PSI_mutex_key key_LOCK_commit, PSI_mutex_key key_LOCK_commit_queue, PSI_mutex_key key_LOCK_after_commit, PSI_mutex_key key_LOCK_after_commit_queue, PSI_mutex_key key_LOCK_done, PSI_mutex_key key_LOCK_flush_queue, PSI_mutex_key key_LOCK_log, PSI_mutex_key key_LOCK_binlog_end_pos, PSI_mutex_key key_LOCK_sync, PSI_mutex_key key_LOCK_sync_queue, PSI_mutex_key key_LOCK_xids, PSI_mutex_key key_LOCK_log_info, PSI_mutex_key key_LOCK_wait_for_group_turn, PSI_cond_key key_COND_done, PSI_cond_key key_COND_flush_queue, PSI_cond_key key_update_cond, PSI_cond_key key_prep_xids_cond, PSI_cond_key key_COND_wait_for_group_turn, PSI_file_key key_file_log, PSI_file_key key_file_log_index, PSI_file_key key_file_log_cache, PSI_file_key key_file_log_index_cache)
Definition: binlog.h:373
char * get_index_fname()
Definition: binlog.h:990
bool write_error
Definition: binlog.h:151
uint * sync_period_ptr
Definition: binlog.h:249
mysql_mutex_t * get_after_commit_lock()
Definition: binlog.h:996
PSI_mutex_key m_key_LOCK_done
The PFS instrumentation key for @ LOCK_done.
Definition: binlog.h:167
std::set< LOG_INFO * > log_info_set
Definition: binlog.h:1120
std::atomic< int32 > m_atomic_prep_xids
Definition: binlog.h:253
Binlog_ofile * m_binlog_file
Definition: binlog.h:152
PSI_mutex_key m_key_LOCK_sync
The instrumentation key to use for @ LOCK_sync.
Definition: binlog.h:183
void add_bytes_written(ulonglong inc)
Definition: binlog.h:713
bool inited
Definition: binlog.h:151
PSI_file_key m_key_file_log_index_cache
The instrumentation key to use for opening a log index cache file.
Definition: binlog.h:201
mysql_mutex_t * get_index_lock()
Definition: binlog.h:994
PSI_mutex_key m_key_LOCK_binlog_end_pos
The instrumentation key to use for @ LOCK_binlog_end_pos.
Definition: binlog.h:161
char index_file_name[FN_REFLEN]
Definition: binlog.h:215
IO_CACHE * get_index_file()
Definition: binlog.h:1002
mysql_cond_t * get_log_cond()
Definition: binlog.h:997
mysql_mutex_t LOCK_log
Definition: binlog.h:147
ulong max_size
Definition: binlog.h:240
bool is_relay_log
Definition: binlog.h:332
PSI_mutex_key m_key_LOCK_index
The instrumentation key to use for @ LOCK_index.
Definition: binlog.h:159
uint get_sync_period()
Definition: binlog.h:269
PSI_cond_key m_key_COND_wait_for_group_turn
The PFS instrumentation key for @ COND_wait_for_group_turn.
Definition: binlog.h:193
PSI_mutex_key m_key_LOCK_log
The instrumentation key to use for @ LOCK_log.
Definition: binlog.h:157
PSI_mutex_key m_key_COND_flush_queue
The PFS instrumentation key for @ COND_flush_queue.
Definition: binlog.h:177
uint file_id
Definition: binlog.h:243
ulonglong bytes_written
Definition: binlog.h:213
mysql_cond_t update_cond
Definition: binlog.h:210
PSI_mutex_key m_key_LOCK_commit
The instrumentation key to use for @ LOCK_commit.
Definition: binlog.h:179
PSI_mutex_key m_key_LOCK_wait_for_group_turn
The PFS instrumentation key for @ LOCK_wait_for_group_turn.
Definition: binlog.h:173
void unlock_index()
Definition: binlog.h:1001
PSI_file_key m_key_file_log
The instrumentation key to use for opening the log file.
Definition: binlog.h:195
PSI_mutex_key m_key_LOCK_sync_queue
The PFS instrumentation key for @ LOCK_sync_queue.
Definition: binlog.h:171
char * get_log_fname()
Definition: binlog.h:991
char purge_index_file_name[FN_REFLEN]
Definition: binlog.h:229
mysql::binlog::event::enum_binlog_checksum_alg relay_log_checksum_alg
Definition: binlog.h:368
Transaction_dependency_tracker m_dependency_tracker
Manage the MTS dependency tracking.
Definition: binlog.h:417
IO_CACHE index_file
Definition: binlog.h:214
mysql_mutex_t LOCK_xids
Definition: binlog.h:209
PSI_file_key m_key_file_log_cache
The instrumentation key to use for opening a log cache file.
Definition: binlog.h:199
uint sync_counter
Definition: binlog.h:250
PSI_file_key m_log_file_key
Instrumentation key to use for file io in log_file.
Definition: binlog.h:155
char * name
Definition: binlog.h:148
char log_file_name[FN_REFLEN]
Definition: binlog.h:149
uint8 checksum_alg_reset
Definition: binlog.h:334
PSI_mutex_key m_key_LOCK_log_info
The instrumentation key to use for @ m_key_LOCK_log_info.
Definition: binlog.h:187
char crash_safe_index_file_name[FN_REFLEN]
Definition: binlog.h:221
static const int MAX_RETRIES_FOR_DELETE_RENAME_FAILURE
Definition: binlog.h:1048
PSI_file_key m_key_file_log_index
The instrumentation key to use for opening the log index file.
Definition: binlog.h:197
Definition: rpl_mi.h:87
Definition: rpl_rli.h:203
Common base class for all row-containing log events.
Definition: log_event.h:2764
Transaction Coordinator Log.
Definition: tc_log.h:144
enum_result
Definition: tc_log.h:160
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
enum_trx_scope
Definition: transaction_info.h:56
Dependency tracker is a container singleton that dispatches between the three methods associated with...
Definition: rpl_trx_tracking.h:186
Represents a bidirectional map between TSID and SIDNO.
Definition: rpl_gtid.h:749
Caches for non-transactional and transactional data before writing it to the binary log.
Definition: binlog.cc:701
This is the base class for verifying transaction boundaries.
Definition: trx_boundary_parser.h:50
Error representation used internally in case final error code is unknown and error situation handling...
Definition: error.h:45
Definition: item_func.h:3021
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
void harvest_bytes_written(Relay_log_info *rli, bool need_log_space_lock)
Adds bytes written in the current relay log into the variable handling the total number of bytes acqu...
Definition: binlog.cc:7828
bool mysql_show_binlog_events(THD *thd)
Execute a SHOW BINLOG EVENTS statement.
Definition: binlog.cc:3637
bool stmt_cannot_safely_rollback(const THD *thd)
This function checks if current statement cannot be rollded back safely.
Definition: binlog.cc:3319
bool normalize_binlog_name(char *to, const char *from, bool is_relay_log)
Turns a relative log binary log path into a full path, based on the opt_bin_logname or opt_relay_logn...
Definition: binlog.cc:245
int write_xa_to_cache(THD *thd)
Logging XA commit/rollback of a prepared transaction.
Definition: binlog.cc:2603
std::pair< int, std::list< std::string > > get_log_index(bool need_lock_index=true)
Retrieves the contents of the index file associated with this log object into an std::list<std::strin...
Definition: binlog.cc:5723
int close_purge_index_file()
Definition: binlog.cc:6240
std::pair< std::list< std::string >, mysql::utils::Error > get_filename_list()
Obtains the list of logs from the index file.
Definition: binlog.cc:1955
void set_max_size(ulong max_size_arg)
Definition: binlog.cc:7847
ulong rpl_read_size
Definition: binlog.cc:188
int flush_cache_to_file(my_off_t *flush_end_pos)
Flush the I/O cache to file.
Definition: binlog.cc:8690
void report_cache_write_error(THD *thd, bool is_transactional)
Definition: binlog.cc:5519
bool is_transaction_empty(THD *thd)
Check if the the transaction is empty.
Definition: binlog.cc:3210
int log_loaded_block(IO_CACHE *file)
Load data's io cache specific hook to be executed before a chunk of data is being read into the cache...
Definition: binlog.cc:3474
bool trans_cannot_safely_rollback(const THD *thd)
This function checks if a transaction cannot be rolled back safely.
Definition: binlog.cc:3306
THD * fetch_and_process_flush_stage_queue(const bool check_and_skip_flush_logs=false)
Fetch and empty BINLOG_FLUSH_STAGE and COMMIT_ORDER_FLUSH_STAGE flush queues and flush transactions t...
Definition: binlog.cc:8460
int rotate(bool force_rotate, bool *check_purge)
The method executes rotation when LOCK_log is already acquired by the caller.
Definition: binlog.cc:7325
void update_thd_next_event_pos(THD *thd)
Definition: binlog.cc:7105
int find_log_pos(LOG_INFO *linfo, const char *log_name, bool need_lock_index)
Find the position in the log-index-file for the given log name.
Definition: binlog.cc:5568
bool trans_has_updated_trans_table(const THD *thd)
This function checks if a transactional table was updated by the current transaction.
Definition: binlog.cc:3248
void close() override
This is called on shutdown, after ha_panic.
Definition: binlog.cc:8054
int new_file_without_locking(Format_description_log_event *extra_description_event)
Definition: binlog.cc:6636
void report_missing_purged_gtids(const Gtid_set *slave_executed_gtid_set, std::string &errmsg)
Function to report the missing GTIDs.
Definition: binlog.cc:9209
uint next_file_id()
Definition: binlog.cc:7447
void cleanup()
Definition: binlog.cc:3685
bool do_write_cache(Binlog_cache_storage *cache, class Binlog_event_writer *writer)
Write the contents of the given IO_CACHE to the binary log.
Definition: binlog.cc:7553
int rollback(THD *thd, bool all) override
Write a rollback record of the transaction to the binary log.
Definition: binlog.cc:2774
void init_pthread_objects()
Definition: binlog.cc:3710
bool reencrypt_logs()
Re-encrypt previous existent binary/relay logs as below.
Definition: binlog.cc:1978
void unregister_log_info(LOG_INFO *log_info)
Unregister LOG_INFO when it is no longer needed.
Definition: binlog.cc:7484
int log_in_use(const char *log_name)
Check if any threads use log name.
Definition: binlog.cc:7490
const char * log_bin_index
Definition: binlog.cc:184
int open_binlog(const char *opt_name)
Definition: binlog.cc:7893
~MYSQL_BIN_LOG() override
Definition: binlog.cc:3681
bool binlog_enabled()
Check whether binlog_hton has valid slot and enabled.
Definition: binlog.cc:1367
bool is_empty_transaction_in_binlog_cache(const THD *thd)
Check if at least one of transacaction and statement binlog caches contains an empty transaction,...
Definition: binlog.cc:3229
int register_purge_index_entry(const char *entry)
Definition: binlog.cc:6271
int sync_purge_index_file()
Definition: binlog.cc:6260
int get_gtid_executed(Tsid_map *tsid_map, Gtid_set *gtid_set)
Deep copy global_tsid_map and gtid_executed.
Definition: binlog.cc:7455
int gtid_end_transaction(THD *thd)
If the thread owns a GTID, this function generates an empty transaction and releases ownership of the...
Definition: binlog.cc:1833
void register_log_info(LOG_INFO *log_info)
Register LOG_INFO so that log_in_use and adjust_linfo_offsets can operate on all logs.
Definition: binlog.cc:7478
int set_purge_index_file_name(const char *base_file_name)
Definition: binlog.cc:6205
void process_commit_stage_queue(THD *thd, THD *queue)
Commit a sequence of sessions.
Definition: binlog.cc:8558
void wait_for_prep_xids()
Wait until the number of prepared XIDs are zero.
Definition: binlog.cc:6606
bool open(PSI_file_key log_file_key, const char *log_name, const char *new_name, uint32 new_index_number)
Open the logfile and init IO_CACHE.
Definition: binlog.cc:3940
bool write_buffer(const char *buf, uint len, Master_info *mi)
Definition: binlog.cc:7046
int open_purge_index_file(bool destroy)
Definition: binlog.cc:6217
int set_crash_safe_index_file_name(const char *base_file_name)
Set the name of crash safe index file.
Definition: binlog.cc:5932
const char * log_bin_basename
Definition: binlog.cc:185
int purge_logs(const char *to_log, bool included, bool need_lock_index, bool need_update_threads, ulonglong *decrease_log_space, bool auto_purge)
Remove all logs before the given log from disk and from the index file.
Definition: binlog.cc:6083
bool truncate_update_log_file(const char *log_name, my_off_t valid_pos, my_off_t binlog_size, bool update)
Truncte log file and clear LOG_EVENT_BINLOG_IN_USE_F when update is set.
Definition: binlog.cc:6987
bool truncate_relaylog_file(Master_info *mi, my_off_t valid_pos)
Truncate the active relay log file in the specified position.
Definition: binlog.cc:8015
void check_binlog_cache_size(THD *thd)
Checks if the BINLOG_CACHE_SIZE's value is greater than MAX_BINLOG_CACHE_SIZE.
Definition: binlog.cc:1328
bool is_current_stmt_binlog_enabled_and_caches_empty(const THD *thd) const
Checks whether binlog caches are disabled (binlog does not cache data) or empty in case binloggging i...
Definition: binlog.cc:3070
bool write_event_to_binlog_and_sync(Log_event *ev)
Definition: binlog.cc:7624
bool read_binlog_in_use_flag(Binlog_file_reader &binlog_file_reader)
Read binary log stream header and Format_desc event from binlog_file_reader.
Definition: binlog.cc:7863
bool is_active(const char *log_file_name) const
Check if we are writing/reading to the given log file.
Definition: binlog.cc:6579
void check_binlog_stmt_cache_size(THD *thd)
Checks if the BINLOG_STMT_CACHE_SIZE's value is greater than MAX_BINLOG_STMT_CACHE_SIZE.
Definition: binlog.cc:1348
std::pair< bool, bool > sync_binlog_file(bool force)
Call fsync() to sync the file to disk.
Definition: binlog.cc:8703
int find_next_relay_log(char log_name[FN_REFLEN+1])
Find the relay log name following the given name from relay log index file.
Definition: binlog.cc:5702
int generate_new_name(char *new_name, const char *log_name, uint32 new_index_number=0)
Definition: binlog.cc:3874
int flush_and_set_pending_rows_event(THD *thd, Rows_log_event *event, bool is_transactional)
Definition: binlog.cc:7121
int finish_commit(THD *thd)
Helper function executed when leaving ordered_commit.
Definition: binlog.cc:8746
bool write_stmt_directly(THD *thd, const char *stmt, size_t stmt_len, enum enum_sql_command sql_command)
Write a dml into statement cache and then flush it into binlog.
Definition: binlog.cc:7579
bool ending_single_stmt_trans(THD *thd, const bool all)
This function checks if a single statement transaction is about to commit or not.
Definition: binlog.cc:3295
int raw_get_current_log(LOG_INFO *linfo)
Definition: binlog.cc:5492
enum_result commit(THD *thd, bool all) override
Commit the transaction in the transaction coordinator.
Definition: binlog.cc:8119
bool check_write_error(const THD *thd)
Definition: binlog.cc:5500
bool purge_source_logs_to_file(THD *thd, const char *to_log)
Purges the binary log files up to the file name passed as a paramenter.
Definition: binlog.cc:3334
int process_flush_stage_queue(my_off_t *total_bytes_var, THD **out_queue_var)
Execute the flush stage.
Definition: binlog.cc:8502
int find_next_log(LOG_INFO *linfo, bool need_lock_index)
Find the position in the log-index-file for the given log name.
Definition: binlog.cc:5656
int wait_for_update()
Wait until we get a signal that the binary log has been updated.
Definition: binlog.cc:7711
void make_log_name(char *buf, const char *log_ident)
Create a new log file name.
Definition: binlog.cc:6568
bool change_stage(THD *thd, Commit_stage_manager::StageID stage, THD *queue, mysql_mutex_t *leave_mutex, mysql_mutex_t *enter_mutex)
Enter a stage of the ordered commit procedure.
Definition: binlog.cc:8659
bool find_first_log(std::string &binlog_file_name, std::string &errmsg)
Find the oldest binary log referenced by the index file.
Definition: binlog.cc:4585
bool write_cache(THD *thd, class binlog_cache_data *cache_data, class Binlog_event_writer *writer)
Write the contents of the statement or transaction cache to the binary log.
Definition: binlog.cc:7661
int remove_logs_outside_range_from_index(LOG_INFO *start_log_info, bool need_update_threads, LOG_INFO *last_log_info=nullptr)
Remove logs from index file, except files between 'start' and 'last'.
Definition: binlog.cc:6016
bool write_event(Log_event *event_info)
Write an event to the binary log cache.
Definition: binlog.cc:7162
void update_binlog_end_pos(bool need_lock=true)
Definition: binlog.cc:9340
int rotate_and_purge(THD *thd, bool force_rotate)
Execute a FLUSH LOGS statement.
Definition: binlog.cc:7415
int get_current_log(LOG_INFO *linfo, bool need_lock_log=true)
Definition: binlog.cc:5484
bool is_query_in_union(THD *thd, query_id_t query_id_param)
Definition: binlog.cc:7096
int new_file_impl(bool need_lock, Format_description_log_event *extra_description_event)
Start writing to a new log file or reopen the old file.
Definition: binlog.cc:6656
bool write_event_to_binlog(Log_event *ev)
Definition: binlog.cc:7603
bool reset_logs(THD *thd, bool delete_only=false)
Removes files, as part of a RESET BINARY LOGS AND GTIDS or RESET REPLICA statement,...
Definition: binlog.cc:5766
bool purge_source_logs_before_date(THD *thd, time_t purge_time)
Execute a PURGE BINARY LOGS BEFORE <date> command.
Definition: binlog.cc:3374
bool stmt_has_updated_trans_table(Ha_trx_info_list const &ha_list)
This function checks if a transactional table was updated by the current statement.
Definition: binlog.cc:3262
bool ending_trans(THD *thd, const bool all)
This function checks if a transaction, either a multi-statement or a single statement transaction is ...
Definition: binlog.cc:3280
int query_error_code(const THD *thd, bool not_killed)
Definition: binlog.cc:3402
void process_after_commit_stage_queue(THD *thd, THD *first)
Process after commit for a sequence of sessions.
Definition: binlog.cc:8631
std::pair< int, my_off_t > flush_thread_caches(THD *thd)
Flush caches for session.
Definition: binlog.cc:8408
bool write_transaction(THD *thd, binlog_cache_data *cache_data, Binlog_event_writer *writer, bool parallelization_barrier)
Write the Gtid_log_event to the binary log (prior to writing the statement or transaction cache).
Definition: binlog.cc:1675
int move_crash_safe_index_file_to_index_file(bool need_lock_index)
Move crash safe index file to index file.
Definition: binlog.cc:5283
void report_missing_gtids(const Gtid_set *previous_gtid_set, const Gtid_set *slave_executed_gtid_set, std::string &errmsg)
Function to report the missing GTIDs.
Definition: binlog.cc:9273
int purge_index_entry(THD *thd, ulonglong *decrease_log_space, bool need_lock_index)
Definition: binlog.cc:6288
bool init_and_set_log_file_name(const char *log_name, const char *new_name, uint32 new_index_number)
Definition: binlog.cc:3914
const char * generate_name(const char *log_name, const char *suffix, char *buff)
Definition: binlog.cc:3895
int purge_logs_before_date(time_t purge_time, bool auto_purge)
Remove all logs before the given file date from disk and from the index file.
Definition: binlog.cc:6452
bool opt_binlog_order_commits
Definition: binlog.cc:182
void init_thd_variables(THD *thd, bool all, bool skip_commit)
Set thread variables used while flushing a transaction.
Definition: binlog.cc:8425
int open_crash_safe_index_file()
Open a (new) crash safe index file.
Definition: binlog.cc:5956
void start_union_events(THD *thd, query_id_t query_id_param)
Definition: binlog.cc:7083
bool is_inited_purge_index_file()
Definition: binlog.cc:6255
bool init_gtid_sets(Gtid_set *all_gtids, Gtid_set *lost_gtids, bool verify_checksum, bool need_lock, mysql::binlog::event::Transaction_boundary_parser *trx_parser, Gtid_monitoring_info *partial_trx, bool is_server_starting=false)
Reads the set of all GTIDs in the binary/relay log, and the set of all lost GTIDs in the binary log,...
Definition: binlog.cc:4698
bool open_index_file(const char *index_file_name_arg, const char *log_name, bool need_lock_index)
Definition: binlog.cc:3993
bool assign_automatic_gtids_to_flush_group(THD *first_seen)
Assign automatic generated GTIDs for all commit group threads in the flush stage having gtid_next....
Definition: binlog.cc:1610
int register_create_index_entry(const char *entry)
Definition: binlog.cc:6283
int close_crash_safe_index_file()
Close the crash safe index file.
Definition: binlog.cc:5988
void auto_purge()
This function runs automatic purge if the conditions to meet automatic purge are met.
Definition: binlog.cc:7355
int prepare(THD *thd, bool all) override
Log a prepare record of the transaction to the storage engines.
Definition: binlog.cc:8066
void handle_binlog_flush_or_sync_error(THD *thd, bool need_lock_log, const char *message)
Helper function to handle flush or sync stage errors.
Definition: binlog.cc:8850
int ordered_commit(THD *thd, bool all, bool skip_commit=false)
Flush and commit the transaction.
Definition: binlog.cc:8898
int add_log_to_index(uchar *log_file_name, size_t name_len, bool need_lock_index)
Append log file name to index file.
Definition: binlog.cc:5441
void adjust_linfo_offsets(my_off_t purge_offset)
Adjust the position pointer in the binary log file for all running replicas.
Definition: binlog.cc:7516
MYSQL_BIN_LOG(uint *sync_period, bool relay_log=false)
Definition: binlog.cc:3658
bool flush_and_sync(const bool force=false)
Flush binlog cache and synchronize to disk.
Definition: binlog.cc:7073
int new_file(Format_description_log_event *extra_description_event)
Definition: binlog.cc:6627
bool show_binlog_events(THD *thd, MYSQL_BIN_LOG *binary_log)
Definition: binlog.cc:3509
void inc_prep_xids(THD *thd)
Increment the prepared XID counter.
Definition: binlog.cc:6583
void dec_prep_xids(THD *thd)
Decrement the prepared XID counter.
Definition: binlog.cc:6594
void stop_union_events(THD *thd)
Definition: binlog.cc:7091
bool flush()
Definition: binlog.cc:7069
void signal_update()
Notifies waiting threads that binary log has been updated.
Definition: binlog.cc:9332
int check_trx_rw_engines(THD *thd, Transaction_ctx::enum_trx_scope trx_scope)
Check if the transaction has no rw flag set for any of the storage engines.
Definition: binlog.cc:3217
bool find_first_log_not_in_gtid_set(char *binlog_file_name, const Gtid_set *gtid_set, Gtid *first_gtid, std::string &errmsg)
Find the oldest binary log that contains any GTID that is not in the given gtid set.
Definition: binlog.cc:4600
void report_binlog_write_error()
Definition: binlog.cc:7703
bool after_write_to_relay_log(Master_info *mi)
Called after an event has been written to the relay log by the IO thread.
Definition: binlog.cc:6891
void auto_purge_at_server_startup()
This member function is to be called at server startup.
Definition: binlog.cc:7343
bool write_incident_commit(THD *thd, std::string_view incident_message)
Write an incident and call commit.
Definition: binlog.cc:2631
#define log_info(...)
Definition: log_client.h:153
unsigned int PSI_cond_key
Instrumented cond key.
Definition: psi_cond_bits.h:44
unsigned int PSI_file_key
Instrumented file key.
Definition: psi_file_bits.h:48
unsigned int PSI_mutex_key
Instrumented mutex key.
Definition: psi_mutex_bits.h:52
#define mysql_mutex_assert_not_owner(M)
Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes.
Definition: mysql_mutex.h:126
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
int64_t int64
Definition: my_inttypes.h:68
int32_t int32
Definition: my_inttypes.h:66
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
Functions related to handling of plugins and other dynamically loaded libraries.
#define MYSQL_PLUGIN_IMPORT
Definition: my_sharedlib.h:71
enum_sql_command
Definition: my_sqlcommand.h:46
Common header for many mysys elements.
uint32 my_thread_id
Definition: my_thread_local.h:34
static int not_killed
Definition: myisamchk.cc:1619
static uint update
Definition: myisamlog.cc:94
static QUEUE queue
Definition: myisampack.cc:210
Common definition between mysql server & client.
#define NAME_LEN
Definition: mysql_com.h:67
Instrumentation helpers for conditions.
ABI for instrumented mutexes.
Type inc(Shards< COUNT > &shards, size_t id)
Increment the counter of a shard by 1.
Definition: ut0counter.h:293
Definition: base.h:75
Definition: buf0block_hint.cc:30
Definition: os0file.h:89
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:498
enum_binlog_checksum_alg
Enumeration spcifying checksum algorithm used to encode a binary log event.
Definition: binlog_event.h:462
Instrumentation helpers for conditions.
Instrumentation helpers for mutexes.
Performance schema instrumentation interface.
Performance schema instrumentation interface.
Instrumentation helpers for mutexes.
required string event
Definition: replication_group_member_actions.proto:32
Definition: binlog.h:89
Item_result type
Definition: binlog.h:93
ulong length
Definition: binlog.h:92
char * value
Definition: binlog.h:91
bool unsigned_flag
Definition: binlog.h:95
user_var_entry * user_var_event
Definition: binlog.h:90
uint charset_number
Definition: binlog.h:94
TODO: Move this structure to mysql/binlog/event/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1100
Definition: my_sys.h:347
Definition: binlog.h:1123
bool log_delayed
Definition: binlog.h:1126
my_off_t last_pos_in_file
Definition: binlog.h:1125
bool logged_data_file
Definition: binlog.h:1126
THD * thd
Definition: binlog.h:1124
Definition: binlog.h:115
my_thread_id thread_id
Definition: binlog.h:122
my_off_t pos
Definition: binlog.h:118
my_off_t index_file_start_offset
Definition: binlog.h:117
LOG_INFO()
Definition: binlog.h:123
bool fatal
Definition: binlog.h:119
char log_file_name[FN_REFLEN]
Definition: binlog.h:116
my_off_t index_file_offset
Definition: binlog.h:117
int entry_index
Definition: binlog.h:120
int encrypted_header_size
Definition: binlog.h:121
Definition: completion_hash.h:35
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50
MySQL mutex implementation.
Include file for Sun RPC to compile out of the box.
Transaction boundary parser definitions.
Item_result
Type of the user defined function return slot and arguments.
Definition: udf_registration_types.h:39
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:885