MySQL 9.1.0
Source Code Documentation
|
Atomic writes handling. More...
#include <sys/types.h>
#include "buf0buf.h"
#include "buf0checksum.h"
#include "log0chkp.h"
#include "os0enc.h"
#include "os0thread-create.h"
#include "page0zip.h"
#include "srv0srv.h"
#include "srv0start.h"
#include "ut0mpmcbq.h"
#include "ut0mutex.h"
#include "ut0test.h"
#include <iomanip>
#include <iostream>
#include <regex>
#include <vector>
Classes | |
struct | dblwr::File |
struct | dblwr::recv::Page |
Page recovered from the doublewrite buffer. More... | |
struct | dblwr::recv::Page_entry |
A record from reduced doublewrite buffer. More... | |
class | dblwr::recv::Pages |
Pages recovered from the doublewrite buffer. More... | |
class | Double_write |
Doublewrite implementation. More... | |
struct | Double_write::Buf_pages |
For collecting pages to write. More... | |
class | Segment |
File segment of a double write file. More... | |
class | Batch_segment |
Segment for batched writes. More... | |
class | Reduced_double_write |
Reduced doublewrite implementation. More... | |
class | Reduced_batch_deserializer |
Reduced doublewrite file deserializer. More... | |
Namespaces | |
namespace | dblwr |
namespace | dblwr::recv |
Functions | |
bool | dblwr::is_odd (uint32_t val) |
std::ostream & | dblwr::operator<< (std::ostream &out, const File &obj) noexcept |
Overload the global output operator to work with dblwr::File type. More... | |
static bool | is_buffer_pool_size_ok () noexcept |
static dberr_t | dblwr_file_open (const std::string &dir_name, int id, dblwr::File &file, ulint file_type, ib_file_suffix extension=DWR) noexcept |
Create the file and or open it if it exists. More... | |
static bool | is_dblwr_page_corrupted (byte *page, fil_space_t *space, page_no_t page_no, dberr_t *err) noexcept |
Check if the dblwr page is corrupted. More... | |
static bool | dblwr::is_encrypted_page (const byte *page) noexcept |
bool | dblwr::has_encrypted_pages () noexcept |
Check if the dblwr files contain encrypted pages. More... | |
Variables | |
constexpr ulint | DBLWR_V1_FSEG = 0 |
Doublewrite buffer. More... | |
constexpr ulint | DBLWR_V1_REPEAT = 12 |
We repeat DBLWR_VER, DBLWR_V1_BLOCK1, DBLWR_V1_BLOCK2 so that if the trx sys header is half-written to disk, we still may be able to recover the information. More... | |
constexpr ulint | DBLWR_V1_SPACE_ID_STORED = (24 + FSEG_HEADER_SIZE) |
If this is not yet set to DBLWR_V1_SPACE_ID_STORED_N, we must reset the doublewrite buffer, because starting from 4.1.x the space id of a data page is stored into FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID. More... | |
constexpr ulint | DBLWR_V1 = 536853855 |
Contents of DBLWR_VER. More... | |
constexpr ulint | DBLWR_V1_SPACE_ID_STORED_N = 1783657386 |
Contents of DBLWR_V1_SPACE_ID_STORED. More... | |
constexpr uint32_t | SYNC_PAGE_FLUSH_SLOTS = 512 |
DBLWR file pages reserved per instance for single page flushes. More... | |
std::string | dblwr::dir {"."} |
Double write files location. More... | |
ulong | dblwr::n_files {1} |
Number of files to use for the double write buffer. More... | |
ulong | dblwr::batch_size {} |
Maximum number of pages to write in one batch. More... | |
ulong | dblwr::n_pages {64} |
Number of pages per doublewrite thread/segment. More... | |
ulong | dblwr::g_mode {Mode::ON} |
DBLWR mode. More... | |
bool | dblwr::is_reduced_inited = false |
true if DETECT_ONLY (aka reduced) mode is inited More... | |
static page_no_t | dblwr::LEGACY_PAGE1 |
Legacy dblwr buffer first segment page number. More... | |
static page_no_t | dblwr::LEGACY_PAGE2 |
Legacy dblwr buffer second segment page number. More... | |
page_id_t | dblwr::Force_crash {UINT32_UNDEFINED, UINT32_UNDEFINED} |
Crash the server after writing this page to the data file. More... | |
Atomic writes handling.
|
staticnoexcept |
Create the file and or open it if it exists.
[in] | dir_name | Directory where to create the file. |
[in] | id | Instance ID. |
[out] | file | File handle. |
[in] | file_type | The file type. |
[in] | extension | .dblwr/.bdblwr |
|
staticnoexcept |
|
staticnoexcept |
Check if the dblwr page is corrupted.
[in] | page | the dblwr page. |
[in] | space | tablespace to which the page belongs. |
[in] | page_no | page_no within the actual tablespace. |
[out] | err | error code to check if decryption or decompression failed. |
|
constexpr |
Contents of DBLWR_VER.
Legacy version, stores the blocks in the system tablespace.
|
constexpr |
Doublewrite buffer.
fseg header of the fseg containing the doublewrite buffer
|
constexpr |
We repeat DBLWR_VER, DBLWR_V1_BLOCK1, DBLWR_V1_BLOCK2 so that if the trx sys header is half-written to disk, we still may be able to recover the information.
|
constexpr |
If this is not yet set to DBLWR_V1_SPACE_ID_STORED_N, we must reset the doublewrite buffer, because starting from 4.1.x the space id of a data page is stored into FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID.
|
constexpr |
Contents of DBLWR_V1_SPACE_ID_STORED.
|
constexpr |
DBLWR file pages reserved per instance for single page flushes.