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