106 template <
typename Tag>
125 [[nodiscard]]
constexpr std::span<const uint8_t>
body() const
noexcept {
189 template <
typename T>
295 other.m_need_to_update_block =
false;
325static_assert(std::is_standard_layout_v<Page_handle>);
338static_assert(std::is_standard_layout_v<Record_handle>);
351 std::span<const uint8_t>
buffer);
This class represents a list of parsed redo records that form an mtr.
Definition: log0redo.h:175
size_t m_size
Full mtr size in bytes occupied in the parsing buffer.
Definition: log0redo.h:197
constexpr size_t size() const noexcept
Returns mtr size in bytes occupied in the parsing buffer.
Definition: log0redo.h:178
constexpr bool empty() const noexcept
Returns true if mtr contains no records.
Definition: log0redo.h:181
void add_record(T &&record)
Add record to the list.
Definition: log0redo.h:190
Record_list m_records
Definition: log0redo.h:199
constexpr const Record_list & records() const noexcept
Returns record list.
Definition: log0redo.h:184
A convenience wrapper over the Page_handle (where redo log records are applied).
Definition: log0redo.h:280
buf_block_t & m_block
Definition: log0redo.h:317
Page_handle m_page_handle
Definition: log0redo.h:318
Page_handle_wrapper(buf_block_t &block)
Definition: log0redo.cc:901
void update_block()
If it is compressed page then update the compressed page metadata in the block.
Definition: log0redo.cc:917
constexpr buf_block_t & block() noexcept
Definition: log0redo.h:306
constexpr Page_handle & handle() noexcept
Definition: log0redo.h:308
~Page_handle_wrapper()
Definition: log0redo.h:303
Page_handle_wrapper(Page_handle_wrapper &&other) noexcept
Definition: log0redo.h:285
bool m_need_to_update_block
Definition: log0redo.h:320
Page_handle_wrapper(const Page_handle_wrapper &)=delete
Parse error description.
Definition: log0redo.h:203
size_t m_pos
Definition: log0redo.h:229
constexpr size_t pos() const noexcept
Returns position in parsing buffer where the error occurred.
Definition: log0redo.h:213
constexpr Parse_error(int code) noexcept
Definition: log0redo.h:223
int m_code
Definition: log0redo.h:228
static constexpr int Corrupted
Buffer contains corrupted data.
Definition: log0redo.h:209
auto & with_pos(size_t pos)
Add position to error description.
Definition: log0redo.h:218
static constexpr int Incomplete
Buffer is too short to parse.
Definition: log0redo.h:206
This class represents a parsed redo record.
Definition: log0redo.h:54
constexpr std::span< const uint8_t > body() const noexcept
Returns reference to record body.
Definition: log0redo.h:125
int m_type
Record type with MLOG_SINGLE_REC_FLAG cleared.
Definition: log0redo.h:151
constexpr const Table_tag & table() const noexcept
Returns table metadata tag.
Definition: log0redo.h:136
Kind
Possible record kinds.
Definition: log0redo.h:57
@ Table
Table metadata record.
@ Space
Table space record.
constexpr Kind kind() const noexcept
Returns record kind.
Definition: log0redo.h:116
Kind m_kind
Definition: log0redo.h:148
constexpr const Page_tag & page() const noexcept
Returns page data tag.
Definition: log0redo.h:130
size_t m_size
Full record size in bytes occupied in the parsing buffer.
Definition: log0redo.h:154
union ib::redo::Record_view::Tag m_tag
constexpr size_t size() const noexcept
Returns record size in bytes occupied in the parsing buffer.
Definition: log0redo.h:122
std::span< const uint8_t > m_body
Record data excluding what consumed by m_type and m_tag.
Definition: log0redo.h:157
constexpr const Space_tag & space() const noexcept
Returns table space tag.
Definition: log0redo.h:142
constexpr int type() const noexcept
Returns record type with MLOG_SINGLE_REC_FLAG cleared.
Definition: log0redo.h:119
constexpr Record_view(int type, size_t size, std::span< const uint8_t > body, Tag &&tag)
Definition: log0redo.h:107
Definition: log0redo.cc:70
This class allows to parse and apply redo records.
Definition: log0redo.h:341
std::unique_ptr< Impl > m_impl
Definition: log0redo.h:362
Redo_applier()
Definition: log0redo.cc:887
bool apply(const Record_handle &record_handle, Page_handle &page_handle)
Apply a parsed redo record to a page.
Definition: log0redo.cc:896
Parse_result< Mtr_view > parse_mtr(std::span< const uint8_t > buffer)
Parse an mtr from a buffer.
Definition: log0redo.cc:891
C++23 std::expected.
Definition: ut0expected.h:74
#define T
Definition: jit_executor_value.cc:373
static int record
Definition: mysqltest.cc:195
Definition: log0common.h:32
std::vector< Record_view > Record_list
Definition: log0redo.h:172
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Define std::hash<Gtid>.
Definition: gtid.h:355
The buffer control block structure.
Definition: buf0buf.h:1756
Definition: log0redo.h:259
uint16_t end_offset
End offset of the modification log.
Definition: log0redo.h:264
uint16_t n_blobs
Number of externally stored columns on the page; the maximum is 744 on a 16 KiB page.
Definition: log0redo.h:267
uint16_t start_offset
Start offset of the modification log that is right after the compressed image in the page.
Definition: log0redo.h:262
Compressed page buffer and metadata about the compressed page.
Definition: log0redo.h:256
const std::span< uint8_t > frame
Compressed page buffer.
Definition: log0redo.h:258
struct ib::redo::Page_handle::Zipped::Metadata metadata
The handle that represents the page where redo log records are applied.
Definition: log0redo.h:245
std::optional< Zipped > zipped
An optional compressed page buffer that needs to be initialized iff this handle represents a compress...
Definition: log0redo.h:273
const std::span< uint8_t > frame
Page buffer.
Definition: log0redo.h:253
const uint32_t space_id
Tablespace id.
Definition: log0redo.h:247
const uint32_t page_no
Page number.
Definition: log0redo.h:250
The handle that represents a log record.
Definition: log0redo.h:329
std::span< const uint8_t > body
Record body.
Definition: log0redo.h:334
uint8_t type
Record type.
Definition: log0redo.h:331
Auxiliary record tag.
Definition: log0redo.h:72
static constexpr Kind kind
Definition: log0redo.h:73
Page data record tag.
Definition: log0redo.h:77
uint32_t space_id
Tablespace id.
Definition: log0redo.h:81
uint32_t page_no
Page number.
Definition: log0redo.h:84
static constexpr Kind kind
Definition: log0redo.h:78
Table space tag.
Definition: log0redo.h:99
static constexpr Kind kind
Definition: log0redo.h:100
uint32_t space_id
Space id.
Definition: log0redo.h:103
Table metadata tag.
Definition: log0redo.h:88
static constexpr Kind kind
Definition: log0redo.h:89
uint64_t table_id
Table id.
Definition: log0redo.h:92
uint64_t version
Metadata version.
Definition: log0redo.h:95
Definition: log0redo.h:159
constexpr Tag(Page_tag &&tag)
Definition: log0redo.h:166
Aux_tag aux
Definition: log0redo.h:160
Page_tag page
Definition: log0redo.h:161
constexpr Tag(Space_tag &&tag)
Definition: log0redo.h:168
Table_tag table
Definition: log0redo.h:162
constexpr Tag(Table_tag &&tag)
Definition: log0redo.h:167
Space_tag space
Definition: log0redo.h:163
constexpr Tag(Aux_tag &&tag)
Definition: log0redo.h:165
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:109
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:97
Minimal implementation of C++23 std::expected.