24#ifndef BINLOG_RECOVERY_H_INCLUDED
25#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:291
Mem_root_allocator is a C++ STL memory allocator based on MEM_ROOT.
Definition: mem_root_allocator.h:68
A Query event is written to the binary log whenever the database is modified on the master,...
Definition: log_event.h:1284
Similar to Xid_log_event except that.
Definition: log_event.h:1784
std::map< XID, enum_ha_recover_xa_state, std::less< XID >, Xa_state_list::allocator > list
Definition: handler.h:1257
This is the subclass of Xid_event defined in libbinlogevent, An XID event is generated for a commit o...
Definition: log_event.h:1740
Recovers from last crashed binlog at server start.
Definition: recovery.h:64
void process_xa_commit(std::string const &query)
Invoked when an XA COMMIT is found in a Query_log_event.
Definition: recovery.cc:232
bool m_is_malformed
Whether or not the binary log is malformed/corrupted.
Definition: recovery.h:158
bool m_no_engine_recovery
Whether or not the recovery in the storage engines failed.
Definition: recovery.h:160
Binlog_file_reader & m_reader
File reader for the last available binary log file.
Definition: recovery.h:152
Mem_root_allocator< my_xid > m_set_alloc
Memory pool allocator to use with the normal transaction list.
Definition: recovery.h:166
Binlog_recovery(Binlog_file_reader &binlog_file_reader)
Class constructor.
Definition: recovery.cc:30
bool has_failures() const
Retrieves whether or not the recovery process ended successfully.
Definition: recovery.cc:43
void process_start()
Invoked when a BEGIN or an ‘XA START’ is found in a Query_log_event.
Definition: recovery.cc:190
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:168
bool m_in_transaction
Whether or not the event being processed is within a transaction.
Definition: recovery.h:156
void process_rollback()
Invoked when a ROLLBACK is found in a Query_log_event.
Definition: recovery.cc:208
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:172
Binlog_recovery & recover()
Uses the provided binary log file reader to inspect the binary log and extract transaction informatio...
Definition: recovery.cc:59
void process_atomic_ddl(Query_log_event const &ev)
Invoked when a DDL is found in a Query_log_event.
Definition: recovery.cc:217
Xid_commit_list m_internal_xids
List of normal transactions fully written to the binary log.
Definition: recovery.h:170
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:158
void process_xa_rollback(std::string const &query)
Invoked when an XA ROLLBACK is found in a Query_log_event.
Definition: recovery.cc:248
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:121
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:143
my_off_t get_valid_pos() const
Retrieves the position of the last binlog event that ended a transaction.
Definition: recovery.cc:39
void process_commit()
Invoked when a COMMIT is found in a Query_log_event.
Definition: recovery.cc:199
std::string const & get_failure_message() const
Retrieves the textual representation of the encontered failure, if any.
Definition: recovery.cc:55
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:264
std::string m_failure_message
Textual representation of the encountered failure.
Definition: recovery.h:162
my_off_t m_valid_pos
Position of the last binlog event that ended a transaction.
Definition: recovery.h:154
bool is_binlog_malformed() const
Retrieves whether or not the binary log was correctly processed in full.
Definition: recovery.cc:47
MEM_ROOT m_mem_root
Memory pool to use for the XID lists.
Definition: recovery.h:164
bool has_engine_recovery_failed() const
Retrieves whether or not the storage engines XA recovery process completed successfully.
Definition: recovery.cc:51
Binary log event definitions.
ulonglong my_off_t
Definition: my_inttypes.h:72
static char * query
Definition: myisam_ftdump.cc:45
Definition: decompressing_event_object_istream.cc:31
enum_ha_recover_xa_state
Enumeration of possible states for externally coordinated transactions (XA).
Definition: handler.h:1232
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:1246
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83