339 void format(std::ostream &out)
const;
Keeps the THD session context to be used with the Bgc_ticket_manager.
Definition: rpl_context.h:286
void assign_ticket()
Assigns the THD session to the ticket accepting assignments in the ticket manager.
Definition: rpl_context.cc:273
bool m_has_waited
Whether or not the session already waited on the ticket.
Definition: rpl_context.h:366
binlog::BgcTicket get_session_ticket()
Retrieves the ticket that the THD session has been assigned to.
Definition: rpl_context.cc:262
bool has_waited()
Whether or not the session already waited on the ticket.
Definition: rpl_context.cc:282
virtual ~Binlog_group_commit_ctx()=default
binlog::BgcTicket m_session_ticket
The ticket the THD session has been assigned to.
Definition: rpl_context.h:364
static memory::Aligned_atomic< bool > & manual_ticket_setting()
Retrieves the flag for determining if it should be possible to manually set the session's ticket.
Definition: rpl_context.cc:308
void format(std::ostream &out) const
Dumps the textual representation of this object into the given output stream.
Definition: rpl_context.cc:299
friend std::ostream & operator<<(std::ostream &out, Binlog_group_commit_ctx const &to_dump)
Dumps the textual representation of an instance of this class into the given output stream.
Definition: rpl_context.h:349
std::string to_string() const
Returns the textual representation of this object;.
Definition: rpl_context.cc:293
void set_session_ticket(binlog::BgcTicket ticket)
Sets the THD session's ticket to the given value.
Definition: rpl_context.cc:266
void reset()
Resets the THD session's ticket context.
Definition: rpl_context.cc:288
void mark_as_already_waited()
Marks the underlying session has already waited on the ticket.
Definition: rpl_context.cc:284
Binlog_group_commit_ctx()=default
Definition: rpl_context.h:225
void set_last_session_sequence_number(int64 sequence_number)
Definition: rpl_context.h:229
int64 m_last_session_sequence_number
Definition: rpl_context.h:238
Dependency_tracker_ctx()
Definition: rpl_context.h:227
int64 get_last_session_sequence_number()
Definition: rpl_context.h:233
Represents a set of GTIDs.
Definition: rpl_gtid.h:1454
This class tracks the last used GTID per session.
Definition: rpl_context.h:244
Last_used_gtid_tracker_ctx()
Definition: rpl_context.cc:190
void get_last_used_gtid(Gtid >id)
Get the last used GTID the session.
Definition: rpl_context.cc:200
std::unique_ptr< Gtid > m_last_used_gtid
Definition: rpl_context.h:264
void set_last_used_gtid(const Gtid >id)
Set the last used GTID the session.
Definition: rpl_context.cc:196
virtual ~Last_used_gtid_tracker_ctx()
Definition: rpl_context.h:373
std::vector< std::function< bool()> > & post_filters_actions()
Definition: rpl_context.h:451
enum_transaction_rpl_delegate_status get_tx_rpl_delegate_stage_status()
Returns the transaction state.
Definition: rpl_context.cc:324
Last_used_gtid_tracker_ctx m_last_used_gtid_tracker_ctx
Definition: rpl_context.h:400
enum_transaction_rpl_delegate_status m_tx_rpl_delegate_stage_status
Definition: rpl_context.h:472
Dependency_tracker_ctx & dependency_tracker_ctx()
Definition: rpl_context.h:424
enum_transaction_rpl_delegate_status
This structure helps to maintain state of transaction.
Definition: rpl_context.h:380
@ TX_RPL_STAGE_CACHE_CREATED
Definition: rpl_context.h:386
@ TX_RPL_STAGE_CONNECTION_CLEANED
Definition: rpl_context.h:392
@ TX_RPL_STAGE_BEFORE_ROLLBACK
Definition: rpl_context.h:390
@ TX_RPL_STAGE_BEGIN
Definition: rpl_context.h:384
@ TX_RPL_STAGE_INIT
Definition: rpl_context.h:382
@ TX_RPL_STAGE_BEFORE_COMMIT
Definition: rpl_context.h:388
@ TX_RPL_STAGE_END
Definition: rpl_context.h:394
Transaction_compression_ctx m_transaction_compression_ctx
Definition: rpl_context.h:401
Dependency_tracker_ctx m_dependency_tracker_ctx
Definition: rpl_context.h:399
void set_tx_rpl_delegate_stage_status(enum_transaction_rpl_delegate_status status)
Sets the transaction states.
Definition: rpl_context.cc:318
std::vector< std::function< bool()> > m_post_filters_actions
Definition: rpl_context.h:404
Transaction_compression_ctx & transaction_compression_ctx()
Definition: rpl_context.h:447
Session_consistency_gtids_ctx m_session_gtids_ctx
Definition: rpl_context.h:398
enum_rpl_channel_type get_rpl_channel_type()
Definition: rpl_context.h:441
Binlog_group_commit_ctx m_binlog_group_commit_ctx
Manages interaction and keeps context w.r.t Bgc_ticket_manager
Definition: rpl_context.h:403
void init()
Initializers.
Definition: rpl_context.cc:313
Session_consistency_gtids_ctx & session_gtids_ctx()
Definition: rpl_context.h:420
Rpl_thd_context()
Definition: rpl_context.h:412
Binlog_group_commit_ctx & binlog_group_commit_ctx()
Retrieves the class member responsible for managing the interaction with Bgc_ticket_manager.
Definition: rpl_context.cc:328
void set_rpl_channel_type(enum_rpl_channel_type rpl_channel_type_arg)
Definition: rpl_context.h:443
Rpl_thd_context(const Rpl_thd_context &rsc)
Last_used_gtid_tracker_ctx & last_used_gtid_tracker_ctx()
Definition: rpl_context.h:428
enum_rpl_channel_type rpl_channel_type
If this thread is a channel, what is its type.
Definition: rpl_context.h:406
Rpl_thd_context & operator=(const Rpl_thd_context &rsc)
This is an interface to be implemented by classes that want to listen to changes to this context.
Definition: rpl_context.h:66
Ctx_change_listener()=default
Ctx_change_listener & operator=(const Ctx_change_listener &rsc)
virtual ~Ctx_change_listener()=default
virtual void notify_session_gtids_ctx_change()=0
Ctx_change_listener(const Ctx_change_listener &rsc)
This class is an interface for session consistency instrumentation in the server.
Definition: rpl_context.h:59
virtual bool notify_after_xa_prepare(const THD *thd)
Definition: rpl_context.h:205
virtual bool notify_after_transaction_commit(const THD *thd)
This function MUST be called after a transaction is committed in the server.
Definition: rpl_context.cc:68
bool shall_collect(const THD *thd)
Definition: rpl_context.cc:56
Session_consistency_gtids_ctx::Ctx_change_listener * m_listener
If a listener is registered, e.g., the session track gtids, then this points to an instance of such l...
Definition: rpl_context.h:103
virtual bool notify_after_gtid_executed_update(const THD *thd)
This function SHALL be called once the GTID for the given transaction has has been added to GTID_EXEC...
Definition: rpl_context.cc:94
Gtid_set * state()
This member function MUST return a reference to the set of collected GTIDs so far.
Definition: rpl_context.h:168
void unregister_ctx_change_listener(Session_consistency_gtids_ctx::Ctx_change_listener *listener)
Unregisters the listener.
Definition: rpl_context.cc:176
Sid_map * m_sid_map
Definition: rpl_context.h:82
virtual bool notify_after_response_packet(const THD *thd)
This function MUST be called after the response packet is set to the client connected.
Definition: rpl_context.cc:142
Gtid_set * m_gtid_set
Set holding the transaction identifiers of the gtids to reply back on the response packet.
Definition: rpl_context.h:94
void notify_ctx_change_listener()
Auxiliary function that allows notification of ctx change listeners.
Definition: rpl_context.h:130
void update_tracking_activeness_from_session_variable(const THD *thd)
Update session tracker (m_curr_session_track_gtids) from thd.
Definition: rpl_context.cc:138
virtual ~Session_consistency_gtids_ctx()
The destructor.
Definition: rpl_context.cc:44
ulong m_curr_session_track_gtids
Keeps track of the current session track gtids, so that we capture according to what was set before.
Definition: rpl_context.h:114
Session_consistency_gtids_ctx(const Session_consistency_gtids_ctx &rsc)
void register_ctx_change_listener(Session_consistency_gtids_ctx::Ctx_change_listener *listener, THD *thd)
Registers the listener.
Definition: rpl_context.cc:158
Session_consistency_gtids_ctx()
Simple constructor.
Definition: rpl_context.cc:38
Session_consistency_gtids_ctx & operator=(const Session_consistency_gtids_ctx &rsc)
Represents a bidirectional map between SID and SIDNO.
Definition: rpl_gtid.h:723
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
Definition: rpl_context.h:267
virtual ~Transaction_compression_ctx()
Definition: rpl_context.cc:211
binary_log::transaction::compression::Compressor * get_compressor(THD *session)
Definition: rpl_context.cc:221
binary_log::transaction::compression::Compressor * m_compressor
Definition: rpl_context.h:278
static const size_t DEFAULT_COMPRESSION_BUFFER_SIZE
Definition: rpl_context.h:269
Transaction_compression_ctx()
Definition: rpl_context.cc:208
The base compressor abstract class.
Definition: base.h:145
Represents the Binlog Group Commit Ticket - BGC Ticket.
Definition: bgc_ticket.h:52
Templated class that encapsulates an std::atomic within a byte buffer that is padded to the processor...
Definition: aligned_atomic.h:151
Some integer typedefs for easier portability.
int64_t int64
Definition: my_inttypes.h:67
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2872
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:60
enum_rpl_channel_type
Type of replication channel thread/transaction might be associated to.
Definition: rpl_context.h:44
@ NO_CHANNEL_INFO
Definition: rpl_context.h:45
@ GR_RECOVERY_CHANNEL
Definition: rpl_context.h:48
@ RPL_STANDARD_CHANNEL
Definition: rpl_context.h:46
@ GR_APPLIER_CHANNEL
Definition: rpl_context.h:47
TODO: Move this structure to libbinlogevents/include/control_events.h when we start using C++11.
Definition: rpl_gtid.h:1065