MySQL  8.0.20
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
6 it under the terms of the GNU General Public License, version 2.0,
7 as published by the Free Software Foundation.
8 
9 This program is also distributed with certain software (including
10 but not limited to OpenSSL) that is licensed under separate terms,
11 as designated in a particular file or component or in included license
12 documentation. The authors of MySQL hereby grant you an additional
13 permission to link the program and your derivative works with the
14 separately licensed software that they have included with MySQL.
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 along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
24 
25 *****************************************************************************/
26 #ifndef log0meb_h
27 #define log0meb_h
28 
29 #include "univ.i"
30 
31 class THD;
32 struct SYS_VAR;
33 struct st_mysql_value;
34 class innodb_session_t;
35 
36 namespace 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. */
45 extern 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 */
56 int validate_redo_log_archive_dirs(THD *thd MY_ATTRIBUTE((unused)),
57  SYS_VAR *var MY_ATTRIBUTE((unused)),
58  void *save, st_mysql_value *value);
59 
60 /**
61  Initialize redo log archiving.
62  To be called when the InnoDB handlerton is initialized.
63 */
64 extern 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 */
70 extern 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 */
105 extern void redo_log_archive_produce(const byte *write_buf,
106  const size_t write_size);
107 
108 } // namespace meb
109 
110 #endif /* !log0meb_h */
Definition: plugin.h:62
Definition: log0meb.h:36
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:1625
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:641
void redo_log_archive_deinit()
De-initialize redo log archiving.
Definition: log0meb.cc:605
Definition: sess0sess.h:70
char * redo_log_archive_dirs
Definition: log0meb.cc:401
Definition: plugin.h:770
mysql_pfs_key_t redo_log_archive_file_key
Performance schema key for the redo log archive file.
Definition: log0meb.cc:63
mysql_pfs_key_t redo_log_archive_consumer_thread_key
Performance schema key for the log consumer thread.
Definition: log0meb.cc:62
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:1573
void redo_log_archive_init()
Initialize redo log archiving.
Definition: log0meb.cc:520
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:765