23#ifndef BINLOG_RECOVERY_H_INCLUDED
24#define BINLOG_RECOVERY_H_INCLUDED
It owns an allocator, a byte stream, an event_data stream and an event object stream.
Definition: binlog_reader.h:246
Mem_root_allocator is a C++ STL memory allocator based on MEM_ROOT.
Definition: mem_root_allocator.h:67
A Query event is written to the binary log whenever the database is modified on the master,...
Definition: log_event.h:1273
Similar to Xid_log_event except that.
Definition: log_event.h:1759
std::map< XID, enum_ha_recover_xa_state, std::less< XID >, Xa_state_list::allocator > list
Definition: handler.h:1255
This is the subclass of Xid_event defined in libbinlogevent, An XID event is generated for a commit o...
Definition: log_event.h:1718
Recovers from last crashed binlog at server start.
Definition: recovery.h:63
void process_xa_commit(std::string const &query)
Invoked when an XA COMMIT is found in a Query_log_event.
Definition: recovery.cc:217
bool m_is_malformed
Whether or not the binary log is malformed/corrupted.
Definition: recovery.h:157
bool m_no_engine_recovery
Whether or not the recovery in the storage engines failed.
Definition: recovery.h:159
Binlog_file_reader & m_reader
File reader for the last available binary log file.
Definition: recovery.h:151
Mem_root_allocator< my_xid > m_set_alloc
Memory pool allocator to use with the normal transaction list.
Definition: recovery.h:165
Binlog_recovery(Binlog_file_reader &binlog_file_reader)
Class constructor.
Definition: recovery.cc:29
bool has_failures() const
Retrieves whether or not the recovery process ended successfully.
Definition: recovery.cc:42
void process_start()
Invoked when a BEGIN or an ‘XA START’ is found in a Query_log_event.
Definition: recovery.cc:175
Mem_root_allocator< std::pair< const XID, XID_STATE::xa_states > > m_map_alloc
Memory pool allocator to use with the XA transaction list.
Definition: recovery.h:167
bool m_in_transaction
Whether or not the event being processed is within a transaction.
Definition: recovery.h:155
void process_rollback()
Invoked when a ROLLBACK is found in a Query_log_event.
Definition: recovery.cc:193
virtual ~Binlog_recovery()=default
Xa_state_list::list m_external_xids
List of XA transactions and states that appear in the binary log.
Definition: recovery.h:171
Binlog_recovery & recover()
Uses the provided binary log file reader to inspect the binary log and extract transaction informatio...
Definition: recovery.cc:58
void process_atomic_ddl(Query_log_event const &ev)
Invoked when a DDL is found in a Query_log_event.
Definition: recovery.cc:202
Xid_commit_list m_internal_xids
List of normal transactions fully written to the binary log.
Definition: recovery.h:169
void process_xa_prepare_event(XA_prepare_log_event const &ev)
Invoked when a XA_prepare_log_event is read from the binary log file reader.
Definition: recovery.cc:143
void process_xa_rollback(std::string const &query)
Invoked when an XA ROLLBACK is found in a Query_log_event.
Definition: recovery.cc:233
void process_query_event(Query_log_event const &ev)
Invoked when a Query_log_event is read from the binary log file reader.
Definition: recovery.cc:106
void process_xid_event(Xid_log_event const &ev)
Invoked when a Xid_log_event is read from the binary log file reader.
Definition: recovery.cc:128
my_off_t get_valid_pos() const
Retrieves the position of the last binlog event that ended a transaction.
Definition: recovery.cc:38
void process_commit()
Invoked when a COMMIT is found in a Query_log_event.
Definition: recovery.cc:184
std::string const & get_failure_message() const
Retrieves the textual representation of the encontered failure, if any.
Definition: recovery.cc:54
void add_external_xid(std::string const &query, enum_ha_recover_xa_state state)
Parses the provided string for an XID and adds it to the externally coordinated transactions map,...
Definition: recovery.cc:249
std::string m_failure_message
Textual representation of the encountered failure.
Definition: recovery.h:161
my_off_t m_valid_pos
Position of the last binlog event that ended a transaction.
Definition: recovery.h:153
bool is_binlog_malformed() const
Retrieves whether or not the binary log was correctly processed in full.
Definition: recovery.cc:46
MEM_ROOT m_mem_root
Memory pool to use for the XID lists.
Definition: recovery.h:163
bool has_engine_recovery_failed() const
Retrieves whether or not the storage engines XA recovery process completed successfully.
Definition: recovery.cc:50
Binary log event definitions.
ulonglong my_off_t
Definition: my_inttypes.h:71
static char * query
Definition: myisam_ftdump.cc:44
enum_ha_recover_xa_state
Enumeration of possible states for externally coordinated transactions (XA).
Definition: handler.h:1230
std::unordered_set< my_xid, std::hash< my_xid >, std::equal_to< my_xid >, Mem_root_allocator< my_xid > > Xid_commit_list
Single occurrence set of XIDs of internally coordinated transactions found as been committed in the t...
Definition: handler.h:1244
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82