MySQL 8.3.0
Source Code Documentation
log0meb.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2018, 2023, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU General Public License, version 2.0,
7as published by the Free Software Foundation.
8
9This program is also distributed with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have included with MySQL.
15
16This program is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19GNU General Public License, version 2.0, for more details.
20
21You should have received a copy of the GNU General Public License
22along with this program; if not, write to the Free Software
23Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26#ifndef log0meb_h
27#define log0meb_h
28
29#include "univ.i"
30
31class THD;
32struct SYS_VAR;
33struct st_mysql_value;
35
36namespace meb {
37
38/** Performance schema key for the log consumer thread. */
40
41/** Performance schema key for the redo log archive file. */
43
44/* The innodb_redo_log_archive_dirs plugin variable value. */
45extern char *redo_log_archive_dirs;
46
47/**
48 Check whether a valid value is given to innodb_redo_log_archive_dirs.
49 This function is registered as a callback with MySQL.
50 @param[in] thd thread handle
51 @param[in] var pointer to system variable
52 @param[out] save immediate result for update function
53 @param[in] value incoming string
54 @return 0 for valid contents
55*/
56int validate_redo_log_archive_dirs(THD *thd [[maybe_unused]],
57 SYS_VAR *var [[maybe_unused]], void *save,
58 st_mysql_value *value);
59
60/**
61 Initialize redo log archiving.
62 To be called when the InnoDB handlerton is initialized.
63*/
64extern void redo_log_archive_init();
65
66/**
67 De-initialize redo log archiving.
68 To be called when the InnoDB handlerton is de-initialized.
69*/
70extern void redo_log_archive_deinit();
71
72/**
73 Security function to be called when the current session ends. This
74 function invokes the stop implementation if this session has started
75 the redo log archiving. It is a safe-guard against an infinitely
76 active redo log archiving if the client goes away without
77 deactivating the logging explicitly.
78
79 @param[in] session the current ending session
80*/
82
83/**
84 The producer produces full QUEUE_BLOCK_SIZE redo log blocks. These
85 log blocks are enqueued, and are later fetched by the consumer
86 thread.
87
88 This function does nothing, if redo log archiving is not active.
89
90 In order to produce full QUEUE_BLOCK_SIZE redo log blocks, the
91 producer scans each OS_FILE_LOG_BLOCK_SIZE log block (written by the
92 server) to check if they are,
93
94 1. empty
95 2. incomplete
96
97 The producer skips empty and incomplete log blocks, unless they
98 belong to the last flush, when the contents of its buffer are
99 completely enqueued for flushing.
100
101 @param[in] write_buf The write buffer that is being written
102 to the redo log archive file.
103 @param[in] write_size The size of the data being written.
104*/
105extern void redo_log_archive_produce(const byte *write_buf,
106 const size_t write_size);
107
108/**
109 @return true iff redo log archiving is active.
110*/
111extern bool redo_log_archive_is_active();
112
113/**
114 Register a privilege. We should move this function and other UDF
115 registration functions to some common utility file later.
116 @param[in] priv_name privilege name
117 @return status
118 @retval false success
119 @retval true failure
120*/
121extern bool register_privilege(const char *priv_name);
122
123} // namespace meb
124
125#endif /* !log0meb_h */
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
Definition: sess0sess.h:70
Definition: log0meb.h:36
mysql_pfs_key_t redo_log_archive_consumer_thread_key
Performance schema key for the log consumer thread.
void redo_log_archive_deinit()
De-initialize redo log archiving.
Definition: log0meb.cc:728
char * redo_log_archive_dirs
Definition: log0meb.cc:411
bool redo_log_archive_is_active()
Definition: log0meb.cc:1829
void redo_log_archive_init()
Initialize redo log archiving.
Definition: log0meb.cc:643
mysql_pfs_key_t redo_log_archive_file_key
Performance schema key for the redo log archive file.
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:764
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:1803
bool register_privilege(const char *priv_name)
Register a privilege.
Definition: log0meb.cc:515
void redo_log_archive_session_end(innodb_session_t *session)
Security function to be called when the current session ends.
Definition: log0meb.cc:1736
Definition: plugin.h:68
Define for performance schema registration key.
Definition: sync0sync.h:50
Definition: system_variables_bits.h:93
Version control for database, common definitions, and include files.