MySQL 9.0.0
Source Code Documentation
binlog_index.h
Go to the documentation of this file.
1/* Copyright (c) 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23#ifndef BINLOG_INDEX_H_INCLUDED
24#define BINLOG_INDEX_H_INCLUDED
25
26#include <set>
27
28#include "my_inttypes.h"
29#include "my_io.h"
30#include "my_sys.h"
31#include "my_thread_local.h"
33#include "mysql/utils/error.h"
34
35class THD;
36
37/* log info errors */
38#define LOG_INFO_EOF -1
39#define LOG_INFO_IO -2
40#define LOG_INFO_INVALID -3
41#define LOG_INFO_SEEK -4
42#define LOG_INFO_MEM -6
43#define LOG_INFO_FATAL -7
44#define LOG_INFO_IN_USE -8
45#define LOG_INFO_EMFILE -9
46#define LOG_INFO_BACKUP_LOCK -10
47#define LOG_INFO_NOT_IN_USE -11
48
49/**
50 Turns a relative log binary log path into a full path, based on the
51 opt_bin_logname or opt_relay_logname. Also trims the cr-lf at the
52 end of the full_path before return to avoid any server startup
53 problem on windows.
54
55 @param from The log name we want to make into an absolute path.
56 @param to The buffer where to put the results of the
57 normalization.
58 @param is_relay_log Switch that makes is used inside to choose which
59 option (opt_bin_logname or opt_relay_logname) to
60 use when calculating the base path.
61
62 @returns true if a problem occurs, false otherwise.
63 */
64bool normalize_binlog_name(char *to, const char *from, bool is_relay_log);
65
66/**
67 Compare log file basenames, i.e. without their directory names
68
69 @return It returns an integer less than, equal to, or greater than zero
70 if log_1 is found, respectively, to be less than, to match,
71 or be greater than log_2
72 */
73int compare_log_name(const char *log_1, const char *log_2);
74
75/**
76 When a fatal error occurs due to which binary logging becomes impossible and
77 the user specified binlog_error_action= ABORT_SERVER the following function is
78 invoked. This function pushes the appropriate error message to client and logs
79 the same to server error log and then aborts the server.
80
81 @param err_string Error string which specifies the exact error
82 message from the caller.
83*/
84void exec_binlog_error_action_abort(const char *err_string);
85
86struct Log_info {
87 Log_info();
88
92 bool fatal; // if the purge happens to give us a negative offset
93 int entry_index; // used in purge_logs(), calculatd in find_log_pos().
96};
97
98/**
99 Binlog_index defines methods which handle binlog index file and its entries.
100 @see Binlog_index_monitor to synchronize access to Binlog_index object.
101*/
103 public:
104 Binlog_index(bool relay_log);
105
106 void set_psi_keys(PSI_file_key key_file_log_index,
107 PSI_file_key key_file_log_index_cache);
108
109 /**
110 @brief Create an index file that will hold all file names used for logging.
111 @param index_file_name_arg name of the index file
112 @param opt opening mode
113 @return false - success, true - failure
114 */
115 bool open_index_file(const char *index_file_name_arg, myf opt);
116
117 /**
118 @brief Close index file
119 @return 0 - success, !0 - failure
120 */
121 int close_index_file();
122
123 /**
124 @brief Check if index file is initalized
125 @return true - initalized, false - otherwise
126 */
128
129 /**
130 @brief Functions to manage purge index file
131 @see purge_index_file
132 */
135 /**
136 @brief simulate failure using fault_injection_registering_index
137 debug symbol
138 */
140 int set_purge_index_file_name(const char *base_file_name);
144 /**
145 @brief Read purge index file name into to buffer of max_length.
146 @param to buffer where to store purge index file name
147 @param max_length length of the to buffer
148 @return number of characters read, 0 on error
149 */
150 int gets_purge_index_file(char *to, size_t max_length);
152 int register_purge_index_entry(const char *entry);
153 int register_create_index_entry(const char *entry);
154
155 /**
156 Find the position in the log-index-file for the given log name.
157
158 @param[out] linfo The found log file name will be stored here, along
159 with the byte offset of the next log file name in the index file.
160 @param log_name Filename to find in the index file, or NULL if we
161 want to read the first entry.
162
163 @note
164 On systems without the truncate function the file will end with one or
165 more empty lines. These will be ignored when reading the file.
166
167 @retval 0 ok
168 @retval LOG_INFO_EOF End of log-index-file found
169 @retval LOG_INFO_IO Got IO error while reading file
170 */
171 int find_log_pos(Log_info *linfo, const char *log_name);
172
173 /**
174 Find the position in the log-index-file for the given log name.
175
176 @param[out] linfo The filename will be stored here, along with the
177 byte offset of the next filename in the index file.
178
179 @note
180 - Before calling this function, one has to call find_log_pos()
181 to set up 'linfo'
182
183 @retval 0 ok
184 @retval LOG_INFO_EOF End of log-index-file found
185 @retval LOG_INFO_IO Got IO error while reading file
186 */
187 int find_next_log(Log_info *linfo);
188
189 /**
190 Append log file name to index file.
191
192 - To make crash safe, we copy all the content of index file
193 to crash safe index file firstly and then append the log
194 file name to the crash safe index file. Finally move the
195 crash safe index file to index file.
196
197 @param log_name Log file name
198 @param log_name_len Length of log file name
199
200 @retval
201 0 ok
202 @retval
203 -1 error
204 */
205 int add_log_to_index(uchar *log_name, size_t log_name_len);
206
207 /**
208 Move crash safe index file to index file.
209
210 @retval 0 ok
211 @retval -1 error
212 */
214
215 /**
216 @brief Remove logs from index file, except files between 'start' and
217 'last'
218 @details To make it crash safe, we copy the content of the index file
219 from index_file_start_offset recorded in log_info to a
220 crash safe index file first and then move the crash
221 safe index file to the index file.
222 @param start_log_info Metadata of the first log to be kept
223 in the index file.
224 @param need_update_threads If we want to update the log coordinates
225 of all threads. False for relay logs,
226 true otherwise.
227 @param last_log_info Metadata of the last log to be kept in the index
228 file; nullptr means that all logs after
229 start_log_info will be kept
230 @retval 0 ok
231 @retval LOG_INFO_IO Got IO error while reading/writing file
232 */
234 bool need_update_threads,
235 Log_info *last_log_info = nullptr);
236
237 /**
238 @brief Register log_info which is used by log_in_use
239 and adjust_linfo_offsets functions.
240 @param log_info - log_info to be registered
241 */
243
244 /**
245 @brief Unregister log_info
246 @param log_info - log_info to be unregistered
247 @see register_log_info
248 */
250
251 /**
252 @brief Return number of logs in use
253 @param log_name log_name to be searched among files registered
254 by register_log_info
255 @return number of logs in use
256 */
257 int log_in_use(const char *log_name);
258
259 /**
260 @brief Adjust all registered log_infos by purge_offset
261 @param purge_offset offset by which log_info are offset
262 */
263 void adjust_linfo_offsets(my_off_t purge_offset);
264
265 const char *get_index_fname() const { return index_file_name; }
266 inline IO_CACHE *get_index_file() { return &index_file; }
267
268 private:
269 /**
270 Open a (new) crash safe index file.
271
272 @note The crash safe index file is a special file
273 used for guaranteeing index file crash safe.
274 @retval 0 ok
275 @retval 1 error
276 */
278
279 /**
280 Close the crash safe index file.
281
282 @note The crash safe file is just closed, is not deleted.
283 Because it is moved to index file later on.
284 @retval 0 ok
285 @retval 1 error
286 */
288
289 /**
290 Set the name of crash safe index file.
291
292 @retval 0 ok
293 @retval 1 error
294 */
295 int set_crash_safe_index_file_name(const char *base_file_name);
296
297 /**
298 @brief Check if crash safe index is initalized
299 @return true - is initalized, false - otherwise
300 */
302
303 /** The instrumentation key to use for opening the log index file. */
305 /** The instrumentation key to use for opening a log index cache file. */
307
310 /**
311 crash_safe_index_file is temp file used for guaranteeing
312 index file crash safe when master server restarts.
313 */
316 /**
317 purge_file is a temp file used in purge_logs so that the index file
318 can be updated before deleting files from disk, yielding better crash
319 recovery. It is created on demand the first time purge_logs is called
320 and then reused for subsequent calls. It is cleaned up in cleanup().
321 */
324
325 const bool is_relay_log;
326 /**
327 Set of log info objects that are in usage and might prevent some other
328 operations from executing.
329 */
330 std::set<Log_info *> log_info_set;
331
333};
334
335/**
336 Binlog_index_monitor synchronizes access to Binlog_index object.
337 Methods defined by Binlog_index are exposed through Binlog_index_monitor
338 class.
339
340 Please keep in mind that LOCK_index is exposed and its lock
341 and unlock methods need to be called with caution.
342*/
344 public:
345 Binlog_index_monitor(bool relay_log);
346
347 void set_psi_keys(PSI_mutex_key key_LOCK_index,
348 PSI_file_key key_file_log_index,
349 PSI_file_key key_file_log_index_cache);
350
352 void cleanup();
353
354 /**
355 @see Binlog_index::open_index_file
356 */
357 bool open_index_file(const char *index_file_name_arg, const char *log_name,
358 PSI_file_key key_file_log, bool need_lock_index);
359
360 /**
361 @see Binlog_index::close_index_file
362 */
363 int close_index_file(bool need_lock_index);
364
365 /**
366 @see Binlog_index::is_inited_index_file
367 */
369
370 /**
371 @see Binlog_index::open_purge_index_file
372 */
376 int set_purge_index_file_name(const char *base_file_name);
380 /**
381 @see Binlog_index::gets_purge_index_file
382 */
383 int gets_purge_index_file(char *to, size_t max_length);
385 int register_purge_index_entry(const char *entry);
386 int register_create_index_entry(const char *entry);
387 int purge_index_entry(THD *thd, ulonglong *decrease_log_space,
388 PSI_file_key key_file_log, bool need_lock_index);
389
390 /**
391 Find the position in the log-index-file for the given log name.
392
393 @param[out] linfo The found log file name will be stored here, along
394 with the byte offset of the next log file name in the index file.
395 @param log_name Filename to find in the index file, or NULL if we
396 want to read the first entry.
397 @param need_lock_index If false, this function acquires LOCK_index;
398 otherwise the lock should already be held by the caller.
399
400 @note
401 On systems without the truncate function the file will end with one or
402 more empty lines. These will be ignored when reading the file.
403
404 @retval
405 0 ok
406 @retval
407 LOG_INFO_EOF End of log-index-file found
408 @retval
409 LOG_INFO_IO Got IO error while reading file
410
411 @see Binlog_index::find_log_pos
412 */
413 int find_log_pos(Log_info *linfo, const char *log_name, bool need_lock_index);
414
415 /**
416 Find the position in the log-index-file for the given log name.
417
418 @param[out] linfo The filename will be stored here, along with the
419 byte offset of the next filename in the index file.
420 @param need_lock_index If true, LOCK_index will be acquired;
421 otherwise it should already be held by the caller.
422
423 @note
424 - Before calling this function, one has to call find_log_pos()
425 to set up 'linfo'
426 - Mutex needed because we need to make sure the file pointer does not move
427 from under our feet
428
429 @retval 0 ok
430 @retval LOG_INFO_EOF End of log-index-file found
431 @retval LOG_INFO_IO Got IO error while reading file
432
433 @see Binlog_index::find_next_log
434 */
435 int find_next_log(Log_info *linfo, bool need_lock_index);
436
437 /**
438 Append log file name to index file.
439
440 - To make crash safe, we copy all the content of index file
441 to crash safe index file firstly and then append the log
442 file name to the crash safe index file. Finally move the
443 crash safe index file to index file.
444
445 @param log_name Log file name
446 @param log_name_len Length of log file name
447 @param need_lock_index If true, LOCK_index will be acquired;
448 otherwise it should already be held by the caller.
449
450 @retval
451 0 ok
452 @retval
453 -1 error
454
455 @see Binlog_index::add_log_to_index
456 */
457 int add_log_to_index(uchar *log_name, size_t log_name_len,
458 bool need_lock_index);
459
460 /**
461 Move crash safe index file to index file.
462
463 @param need_lock_index If true, LOCK_index will be acquired;
464 otherwise it should already be held.
465
466 @retval 0 ok
467 @retval -1 error
468
469 @see Binlog_index::move_crash_safe_index_file_to_index_file
470 */
471 int move_crash_safe_index_file_to_index_file(bool need_lock_index);
472
473 /**
474 @see Binlog_index::remove_logs_outside_range_from_index
475 */
477 bool need_update_threads,
478 Log_info *last_log_info = nullptr);
479
480 /**
481 @brief Remove logs from index file except logs between first and last
482 @param first Filename of the first relay log to be kept in index file
483 @param need_update_threads If we want to update the log coordinates
484 of all threads. False for relay logs,
485 true otherwise
486 @param last Filename of the last relay log to be kept in index file
487
488 @retval 0 OK
489 @retval LOG_INFO_IO Got IO error while reading/writing file
490 @retval LOG_INFO_EOF Could not find requested log file (first or last)
491 */
492 int remove_logs_outside_range_from_index(const std::string &first,
493 bool need_update_threads,
494 const std::string &last);
495
496 /**
497 @see Binlog_index::register_log_info
498 */
500
501 /**
502 @see Binlog_index::unregister_log_info
503 */
505
506 /**
507 Check if any threads use log name.
508 @note This method expects the LOCK_index to be taken so there are no
509 concurrent edits against linfo objects being iterated
510 @param log_name name of a log which is checked for usage
511
512 */
513 int log_in_use(const char *log_name);
514
515 /**
516 @see Binlog_index::adjust_linfo_offsets
517 */
518 void adjust_linfo_offsets(my_off_t purge_offset);
519
520 const char *get_index_fname() const;
522
523 /**
524 Retrieves the contents of the index file associated with this log object
525 into an `std::list<std::string>` object. The order held by the index file is
526 kept.
527
528 @param need_lock_index whether or not the lock over the index file should be
529 acquired inside the function.
530
531 @return a pair: a function status code; a list of `std::string` objects with
532 the content of the log index file.
533 */
534 std::pair<int, std::list<std::string>> get_log_index(
535 bool need_lock_index = true);
536
537 /**
538 @brief Obtains the list of logs from the index file
539 @return List of log filenames
540 */
541 std::pair<std::list<std::string>, mysql::utils::Error> get_filename_list();
542
543 /**
544 Find the relay log name following the given name from relay log index file.
545 @param[in,out] log_name The name is full path name.
546 @return return 0 if it finds next relay log. Otherwise return the error
547 code.
548 */
549 int find_next_relay_log(char log_name[FN_REFLEN + 1]);
550
552
554 inline void lock() { mysql_mutex_lock(&m_LOCK_index); }
557
558 private:
559 /** The instrumentation key to use for @ LOCK_index. */
561
562 /** POSIX thread objects are inited by init_pthread_objects() */
565 const bool m_is_relay_log;
566};
567
568#endif /* BINLOG_INDEX_H_INCLUDED */
int destroy(azio_stream *s)
Definition: azio.cc:371
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_index.cc:77
int compare_log_name(const char *log_1, const char *log_2)
Compare log file basenames, i.e.
Definition: binlog_index.cc:132
void exec_binlog_error_action_abort(const char *err_string)
When a fatal error occurs due to which binary logging becomes impossible and the user specified binlo...
Definition: binlog_index.cc:139
Binlog_index_monitor synchronizes access to Binlog_index object.
Definition: binlog_index.h:343
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_index.cc:1129
int error_purge_index_file()
Definition: binlog_index.cc:871
int register_create_index_entry(const char *entry)
Definition: binlog_index.cc:877
void lock()
Definition: binlog_index.h:554
void unregister_log_info(Log_info *log_info)
Definition: binlog_index.cc:1063
int reinit_purge_index_file()
Definition: binlog_index.cc:862
int add_log_to_index(uchar *log_name, size_t log_name_len, bool need_lock_index)
Append log file name to index file.
Definition: binlog_index.cc:1067
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_index.cc:1116
IO_CACHE * get_index_file()
Definition: binlog_index.h:521
int open_purge_index_file(bool destroy)
Definition: binlog_index.cc:846
int register_purge_index_entry(const char *entry)
Definition: binlog_index.cc:874
int close_purge_index_file()
Definition: binlog_index.cc:849
void cleanup()
Definition: binlog_index.cc:784
bool is_inited_index_file()
Definition: binlog_index.cc:842
const char * get_index_fname() const
Definition: binlog_index.cc:1095
int remove_logs_outside_range_from_index(Log_info *start_log_info, bool need_update_threads, Log_info *last_log_info=nullptr)
Definition: binlog_index.cc:1038
const bool m_is_relay_log
Definition: binlog_index.h:565
int sync_purge_index_file()
Definition: binlog_index.cc:865
Binlog_index & get_index()
Definition: binlog_index.h:551
int gets_purge_index_file(char *to, size_t max_length)
Definition: binlog_index.cc:868
bool is_inited_purge_index_file()
Definition: binlog_index.cc:859
mysql_mutex_t m_LOCK_index
POSIX thread objects are inited by init_pthread_objects()
Definition: binlog_index.h:563
void unlock()
Definition: binlog_index.h:555
void init_pthread_objects()
Definition: binlog_index.cc:780
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_index.cc:1177
int purge_index_entry(THD *thd, ulonglong *decrease_log_space, PSI_file_key key_file_log, bool need_lock_index)
Definition: binlog_index.cc:881
int end_close_purge_index_file()
Definition: binlog_index.cc:852
int set_purge_index_file_name(const char *base_file_name)
Definition: binlog_index.cc:855
void adjust_linfo_offsets(my_off_t purge_offset)
Definition: binlog_index.cc:1090
void assert_owner()
Definition: binlog_index.h:556
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_index.cc:1099
int log_in_use(const char *log_name)
Check if any threads use log name.
Definition: binlog_index.cc:1085
mysql_mutex_t * get_index_lock()
Definition: binlog_index.h:553
void register_log_info(Log_info *log_info)
Definition: binlog_index.cc:1060
Binlog_index m_binlog_index
Definition: binlog_index.h:564
PSI_mutex_key m_key_LOCK_index
The instrumentation key to use for @ LOCK_index.
Definition: binlog_index.h:560
Binlog_index_monitor(bool relay_log)
Definition: binlog_index.cc:770
bool open_index_file(const char *index_file_name_arg, const char *log_name, PSI_file_key key_file_log, bool need_lock_index)
Definition: binlog_index.cc:786
void set_psi_keys(PSI_mutex_key key_LOCK_index, PSI_file_key key_file_log_index, PSI_file_key key_file_log_index_cache)
Definition: binlog_index.cc:773
int move_crash_safe_index_file_to_index_file(bool need_lock_index)
Move crash safe index file to index file.
Definition: binlog_index.cc:1024
std::pair< std::list< std::string >, mysql::utils::Error > get_filename_list()
Obtains the list of logs from the index file.
Definition: binlog_index.cc:1153
int close_index_file(bool need_lock_index)
Definition: binlog_index.cc:829
Binlog_index defines methods which handle binlog index file and its entries.
Definition: binlog_index.h:102
int end_close_purge_index_file()
simulate failure using fault_injection_registering_index debug symbol
Definition: binlog_index.cc:354
int log_in_use(const char *log_name)
Return number of logs in use.
Definition: binlog_index.cc:736
int open_crash_safe_index_file()
Open a (new) crash safe index file.
Definition: binlog_index.cc:264
bool is_inited_index_file()
Check if index file is initalized.
Definition: binlog_index.cc:262
int set_crash_safe_index_file_name(const char *base_file_name)
Set the name of crash safe index file.
Definition: binlog_index.cc:299
IO_CACHE index_file
Definition: binlog_index.h:308
char crash_safe_index_file_name[FN_REFLEN]
Definition: binlog_index.h:315
Binlog_index(bool relay_log)
Definition: binlog_index.cc:185
int open_purge_index_file(bool destroy)
Functions to manage purge index file.
Definition: binlog_index.cc:316
int set_purge_index_file_name(const char *base_file_name)
Definition: binlog_index.cc:367
int close_purge_index_file()
Definition: binlog_index.cc:339
int reinit_purge_index_file()
Definition: binlog_index.cc:383
int close_index_file()
Close index file.
Definition: binlog_index.cc:251
void set_psi_keys(PSI_file_key key_file_log_index, PSI_file_key key_file_log_index_cache)
Definition: binlog_index.cc:189
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_index.cc:684
char purge_index_file_name[FN_REFLEN]
Definition: binlog_index.h:323
PSI_file_key m_key_file_log_index
The instrumentation key to use for opening the log index file.
Definition: binlog_index.h:304
void unregister_log_info(Log_info *log_info)
Unregister log_info.
Definition: binlog_index.cc:731
int close_crash_safe_index_file()
Close the crash safe index file.
Definition: binlog_index.cc:285
void adjust_linfo_offsets(my_off_t purge_offset)
Adjust all registered log_infos by purge_offset.
Definition: binlog_index.cc:754
char index_file_name[FN_REFLEN]
Definition: binlog_index.h:309
int register_create_index_entry(const char *entry)
Definition: binlog_index.cc:416
int add_log_to_index(uchar *log_name, size_t log_name_len)
Append log file name to index file.
Definition: binlog_index.cc:511
IO_CACHE purge_index_file
purge_file is a temp file used in purge_logs so that the index file can be updated before deleting fi...
Definition: binlog_index.h:322
int sync_purge_index_file()
Definition: binlog_index.cc:387
int gets_purge_index_file(char *to, size_t max_length)
Read purge index file name into to buffer of max_length.
Definition: binlog_index.cc:398
IO_CACHE * get_index_file()
Definition: binlog_index.h:266
void register_log_info(Log_info *log_info)
Register log_info which is used by log_in_use and adjust_linfo_offsets functions.
Definition: binlog_index.cc:726
bool is_inited_crash_safe_index_file()
Check if crash safe index is initalized.
Definition: binlog_index.cc:312
const char * get_index_fname() const
Definition: binlog_index.h:265
int find_next_log(Log_info *linfo)
Find the position in the log-index-file for the given log name.
Definition: binlog_index.cc:478
const bool is_relay_log
Definition: binlog_index.h:325
int find_log_pos(Log_info *linfo, const char *log_name)
Find the position in the log-index-file for the given log name.
Definition: binlog_index.cc:420
int error_purge_index_file()
Definition: binlog_index.cc:402
IO_CACHE crash_safe_index_file
crash_safe_index_file is temp file used for guaranteeing index file crash safe when master server res...
Definition: binlog_index.h:314
int move_crash_safe_index_file_to_index_file()
Move crash safe index file to index file.
Definition: binlog_index.cc:546
static const int MAX_RETRIES_FOR_DELETE_RENAME_FAILURE
Definition: binlog_index.h:332
bool open_index_file(const char *index_file_name_arg, myf opt)
Create an index file that will hold all file names used for logging.
Definition: binlog_index.cc:195
int register_purge_index_entry(const char *entry)
Definition: binlog_index.cc:404
PSI_file_key m_key_file_log_index_cache
The instrumentation key to use for opening a log index cache file.
Definition: binlog_index.h:306
std::set< Log_info * > log_info_set
Set of log info objects that are in usage and might prevent some other operations from executing.
Definition: binlog_index.h:330
bool is_inited_purge_index_file()
Definition: binlog_index.cc:379
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Error representation used internally in case final error code is unknown and error situation handling...
Definition: error.h:45
#define mysql_mutex_lock(M)
Definition: mysql_mutex.h:50
#define mysql_mutex_unlock(M)
Definition: mysql_mutex.h:57
#define log_info(...)
Definition: log_client.h:153
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_owner(M)
Wrapper, to use safe_mutex_assert_owner with instrumented mutexes.
Definition: mysql_mutex.h:112
Experimental API header.
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:83
Common header for many mysys elements.
uint32 my_thread_id
Definition: my_thread_local.h:34
Performance schema instrumentation interface.
Definition: my_sys.h:346
Definition: binlog_index.h:86
bool fatal
Definition: binlog_index.h:92
my_off_t index_file_offset
Definition: binlog_index.h:90
Log_info()
Definition: binlog_index.cc:174
char log_file_name[FN_REFLEN]
Definition: binlog_index.h:89
my_thread_id thread_id
Definition: binlog_index.h:95
my_off_t index_file_start_offset
Definition: binlog_index.h:90
int entry_index
Definition: binlog_index.h:93
my_off_t pos
Definition: binlog_index.h:91
int encrypted_header_size
Definition: binlog_index.h:94
Definition: completion_hash.h:35
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50