MySQL  8.0.18
Source Code Documentation
log0meb.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 2018, 2019, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 #ifndef log0meb_h
19 #define log0meb_h
20 
21 #include "univ.i"
22 
23 class THD;
24 struct SYS_VAR;
25 struct st_mysql_value;
26 class innodb_session_t;
27 
28 /* The innodb_directories plugin variable value. */
29 extern char *innobase_directories;
30 
31 namespace meb {
32 
33 /** Performance schema key for the log consumer thread. */
35 
36 /** Performance schema key for the redo log archive file. */
38 
39 /* The innodb_redo_log_archive_dirs plugin variable value. */
40 extern char *redo_log_archive_dirs;
41 
42 /**
43  Check whether a valid value is given to innodb_redo_log_archive_dirs.
44  This function is registered as a callback with MySQL.
45  @param[in] thd thread handle
46  @param[in] var pointer to system variable
47  @param[out] save immediate result for update function
48  @param[in] value incoming string
49  @return 0 for valid contents
50 */
51 int validate_redo_log_archive_dirs(THD *thd MY_ATTRIBUTE((unused)),
52  SYS_VAR *var MY_ATTRIBUTE((unused)),
53  void *save, st_mysql_value *value);
54 
55 /**
56  Initialize redo log archiving.
57  To be called when the InnoDB handlerton is initialized.
58 */
59 extern void redo_log_archive_init();
60 
61 /**
62  De-initialize redo log archiving.
63  To be called when the InnoDB handlerton is de-initialized.
64 */
65 extern void redo_log_archive_deinit();
66 
67 /**
68  Security function to be called when the current session ends. This
69  function invokes the stop implementation if this session has started
70  the redo log archiving. It is a safe-guard against an infinitely
71  active redo log archiving if the client goes away without
72  deactivating the logging explicitly.
73 
74  @param[in] session the current ending session
75 */
77 
78 /**
79  The producer produces full QUEUE_BLOCK_SIZE redo log blocks. These
80  log blocks are enqueued, and are later fetched by the consumer
81  thread.
82 
83  This function does nothing, if redo log archiving is not active.
84 
85  In order to produce full QUEUE_BLOCK_SIZE redo log blocks, the
86  producer scans each OS_FILE_LOG_BLOCK_SIZE log block (written by the
87  server) to check if they are,
88 
89  1. empty
90  2. incomplete
91 
92  The producer skips empty and incomplete log blocks, unless they
93  belong to the last flush, when the contents of its buffer are
94  completely enqueued for flushing.
95 
96  @param[in] write_buf The write buffer that is being written
97  to the redo log archive file.
98  @param[in] write_size The size of the data being written.
99 */
100 extern void redo_log_archive_produce(const byte *write_buf,
101  const size_t write_size);
102 
103 } // namespace meb
104 
105 #endif /* !log0meb_h */
Definition: plugin.h:62
char * innobase_directories
Definition: ha_innodb.cc:257
Definition: log0meb.h:31
MYSQL_SESSION session[9]
Definition: test_sql_9_sessions.cc:65
void redo_log_archive_produce(const byte *write_buf, const size_t write_size)
The producer produces full QUEUE_BLOCK_SIZE redo log blocks.
Definition: log0meb.cc:1491
int validate_redo_log_archive_dirs(THD *thd, SYS_VAR *var, void *save, st_mysql_value *value)
Check whether a valid value is given to innodb_redo_log_archive_dirs.
Definition: log0meb.cc:616
void redo_log_archive_deinit()
De-initialize redo log archiving.
Definition: log0meb.cc:580
Definition: sess0sess.h:70
char * redo_log_archive_dirs
Definition: log0meb.cc:383
Definition: plugin.h:745
mysql_pfs_key_t redo_log_archive_file_key
Performance schema key for the redo log archive file.
Definition: log0meb.cc:55
mysql_pfs_key_t redo_log_archive_consumer_thread_key
Performance schema key for the log consumer thread.
Definition: log0meb.cc:54
const string value("\alue\)
Define for performance schema registration key.
Definition: sync0sync.h:50
unsigned char byte
Blob class.
Definition: common.h:159
void redo_log_archive_session_end(innodb_session_t *session)
Security function to be called when the current session ends.
Definition: log0meb.cc:1439
void redo_log_archive_init()
Initialize redo log archiving.
Definition: log0meb.cc:495
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:778