24#ifndef PIPELINE_STATS_INCLUDED
25#define PIPELINE_STATS_INCLUDED
125 int32 transactions_waiting_certification,
126 int32 transactions_waiting_apply,
int64 transactions_certified,
127 int64 transactions_applied,
int64 transactions_local,
128 int64 transactions_negative_certified,
int64 transactions_rows_validating,
129 bool transaction_gtids,
130 const std::string &transactions_committed_all_members,
131 const std::string &transactions_last_conflict_free,
247 const unsigned char *
end)
override;
620 const std::string &member_id);
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:309
The pipeline stats aggregator of all group members stats and flow control module.
Definition: pipeline_stats.h:593
Flow_control_module()
Default constructor.
Definition: pipeline_stats.cc:719
Flow_control_module_info m_info
Definition: pipeline_stats.h:653
int seconds_to_skip
Definition: pipeline_stats.h:679
std::atomic< int64 > m_quota_used
Definition: pipeline_stats.h:668
static const int64 MAXTPS
Definition: pipeline_stats.h:595
int32 do_wait()
Compute and wait the amount of time in microseconds that must be elapsed before a new message is sent...
Definition: pipeline_stats.cc:995
mysql_cond_t m_flow_control_cond
Definition: pipeline_stats.h:651
virtual ~Flow_control_module()
Destructor.
Definition: pipeline_stats.cc:736
void flow_control_step(Pipeline_stats_member_collector *)
Evaluate the information received in the last flow control period and adjust the system parameters ac...
Definition: pipeline_stats.cc:742
mysql_mutex_t m_flow_control_lock
Definition: pipeline_stats.h:650
std::atomic< int32 > m_holds_in_period
Definition: pipeline_stats.h:663
int handle_stats_data(const uchar *data, size_t len, const std::string &member_id)
Handles a Pipeline_stats_message, updating the Flow_control_module_info and the delay,...
Definition: pipeline_stats.cc:936
uint64 m_stamp
Definition: pipeline_stats.h:674
Pipeline_member_stats * get_pipeline_stats(const std::string &member_id)
Returns copy of individual member stats information.
Definition: pipeline_stats.cc:973
std::atomic< int64 > m_quota_size
Definition: pipeline_stats.h:669
Checkable_rwlock * m_flow_control_module_info_lock
Definition: pipeline_stats.h:657
Computed statistics per member.
Definition: pipeline_stats.h:418
std::string m_transaction_last_conflict_free
Definition: pipeline_stats.h:575
int64 m_delta_transactions_certified
Definition: pipeline_stats.h:567
void set_transaction_committed_all_members(char *str, size_t len)
Set the stable group transactions.
Definition: pipeline_stats.cc:685
Flow_control_mode m_flow_control_mode
Definition: pipeline_stats.h:577
void get_transaction_last_conflict_free(std::string &value)
Get the last positive certified transaction.
Definition: pipeline_stats.cc:690
int64 m_transactions_applied
Definition: pipeline_stats.h:568
uint64 get_stamp()
Get the last stats update stamp.
Definition: pipeline_stats.cc:704
int64 get_transactions_certified()
Get transactions certified counter value.
Definition: pipeline_stats.cc:656
int64 m_delta_transactions_local
Definition: pipeline_stats.h:571
int32 m_transactions_waiting_certification
Definition: pipeline_stats.h:564
void set_transaction_last_conflict_free(std::string &value)
Set the last positive certified transaction.
Definition: pipeline_stats.cc:695
int64 get_transactions_local()
Get local member transactions proposed counter value.
Definition: pipeline_stats.cc:664
int64 get_transactions_negative_certified()
Get transactions negatively certified.
Definition: pipeline_stats.cc:668
std::string m_transactions_committed_all_members
Definition: pipeline_stats.h:574
int64 get_delta_transactions_applied()
Get transactions applied since last stats message.
Definition: pipeline_stats.cc:648
int32 get_transactions_waiting_certification()
Get transactions waiting certification counter value.
Definition: pipeline_stats.cc:636
uint64 m_stamp
Definition: pipeline_stats.h:578
Flow_control_mode get_flow_control_mode()
Get flow_control_mode of a member.
Definition: pipeline_stats.cc:700
int32 get_transactions_waiting_apply()
Get transactions waiting apply counter value.
Definition: pipeline_stats.cc:640
Pipeline_member_stats()
Default constructor.
Definition: pipeline_stats.cc:525
int64 m_transactions_local
Definition: pipeline_stats.h:570
void debug(const char *member, int64 quota_size, int64 quota_used)
Definition: pipeline_stats.cc:707
void get_transaction_committed_all_members(std::string &value)
Get the stable group transactions.
Definition: pipeline_stats.cc:680
int64 m_transactions_negative_certified
Definition: pipeline_stats.h:572
int64 m_transactions_rows_validating
Definition: pipeline_stats.h:573
int64 m_transactions_certified
Definition: pipeline_stats.h:566
int32 m_transactions_waiting_apply
Definition: pipeline_stats.h:565
int64 get_transactions_rows_validating()
Get certification database counter value.
Definition: pipeline_stats.cc:672
void update_member_stats(Pipeline_stats_member_message &msg, uint64 stamp)
Updates member statistics with a new message from the network.
Definition: pipeline_stats.cc:583
int64 get_delta_transactions_certified()
Get transactions certified since last stats message.
Definition: pipeline_stats.cc:644
int64 m_transactions_local_rollback
Definition: pipeline_stats.h:576
int64 get_delta_transactions_local()
Get local transactions that member tried to commit since last stats message.
Definition: pipeline_stats.cc:652
bool is_flow_control_needed()
Returns true if the node is behind on some user-defined criteria.
Definition: pipeline_stats.cc:628
int64 m_delta_transactions_applied
Definition: pipeline_stats.h:569
int64 get_transactions_local_rollback()
Get local member transactions negatively certified.
Definition: pipeline_stats.cc:676
int64 get_transactions_applied()
Get transactions applied counter value.
Definition: pipeline_stats.cc:660
The pipeline collector for the local member stats.
Definition: pipeline_stats.h:269
int64 get_transactions_local_rollback()
Definition: pipeline_stats.cc:401
void decrement_transactions_waiting_apply()
Decrement transactions waiting apply counter value.
Definition: pipeline_stats.cc:363
std::atomic< uint64 > m_delta_transactions_applied_during_recovery
Definition: pipeline_stats.h:406
void increment_transactions_applied()
Increment transactions applied counter value.
Definition: pipeline_stats.cc:373
std::atomic< int64 > m_transactions_certified
Definition: pipeline_stats.h:397
Pipeline_stats_member_collector()
Default constructor.
Definition: pipeline_stats.cc:329
void clear_transactions_waiting_apply()
Set transactions waiting apply counter to 0.
Definition: pipeline_stats.cc:350
std::atomic< uint64 > m_transactions_certified_during_recovery
Definition: pipeline_stats.h:402
int64 get_transactions_applied()
Definition: pipeline_stats.cc:393
void increment_transactions_certified()
Increment transactions certified counter value.
Definition: pipeline_stats.cc:369
void increment_transactions_local()
Increment local transactions counter value.
Definition: pipeline_stats.cc:377
void compute_transactions_deltas_during_recovery()
Compute the transactions applied during last flow-control tick while the member is in recovery.
Definition: pipeline_stats.cc:425
void send_stats_member_message(Flow_control_mode mode)
Send member statistics to group.
Definition: pipeline_stats.cc:472
uint64 get_delta_transactions_applied_during_recovery()
Definition: pipeline_stats.cc:434
std::atomic< uint64 > m_transactions_certified_negatively_during_recovery
Definition: pipeline_stats.h:403
std::atomic< int64 > m_transactions_local_rollback
Definition: pipeline_stats.h:400
void increment_transactions_certified_during_recovery()
Increment certified transactions during recovery counter value.
Definition: pipeline_stats.cc:410
std::atomic< int64 > m_transactions_applied
Definition: pipeline_stats.h:398
void increment_transactions_waiting_apply()
Increment transactions waiting apply counter value.
Definition: pipeline_stats.cc:356
mysql_mutex_t m_transactions_waiting_apply_lock
Definition: pipeline_stats.h:410
std::atomic< uint64 > m_transactions_delivered_during_recovery
Definition: pipeline_stats.h:407
uint64 get_transactions_waiting_apply_during_recovery()
Definition: pipeline_stats.cc:439
void increment_transactions_certified_negatively_during_recovery()
Increment negatively certified transactions during recovery counter value.
Definition: pipeline_stats.cc:415
int32 get_transactions_waiting_apply()
Definition: pipeline_stats.cc:385
uint64 m_previous_transactions_applied_during_recovery
Definition: pipeline_stats.h:405
uint64 get_transactions_waiting_certification_during_recovery()
Definition: pipeline_stats.cc:465
void increment_transactions_applied_during_recovery()
Increment local recovery transactions counter value.
Definition: pipeline_stats.cc:420
void increment_transactions_local_rollback()
Increment local rollback transactions counter value.
Definition: pipeline_stats.cc:381
int64 get_transactions_local()
Definition: pipeline_stats.cc:397
bool send_transaction_identifiers
Definition: pipeline_stats.h:409
void set_send_transaction_identifiers()
Send Transaction Identifiers or not.
Definition: pipeline_stats.cc:405
std::atomic< int64 > m_transactions_local
Definition: pipeline_stats.h:399
std::atomic< int32 > m_transactions_waiting_apply
Definition: pipeline_stats.h:396
int64 get_transactions_certified()
Definition: pipeline_stats.cc:389
std::atomic< uint64 > m_transactions_applied_during_recovery
Definition: pipeline_stats.h:404
void increment_transactions_delivered_during_recovery()
Increment delivered transactions during recovery counter value.
Definition: pipeline_stats.cc:460
virtual ~Pipeline_stats_member_collector()
Destructor.
Definition: pipeline_stats.cc:346
Describes all statistics sent by members.
Definition: pipeline_stats.h:48
int64 m_transactions_rows_validating
Definition: pipeline_stats.h:256
enum_payload_item_type
Definition: pipeline_stats.h:50
@ PIT_TRANSACTIONS_CERTIFIED
Definition: pipeline_stats.h:61
@ PIT_TRANSACTIONS_COMMITTED_ALL_MEMBERS
Definition: pipeline_stats.h:76
@ PIT_TRANSACTION_LAST_CONFLICT_FREE
Definition: pipeline_stats.h:79
@ PIT_TRANSACTIONS_APPLIED
Definition: pipeline_stats.h:64
@ PIT_TRANSACTIONS_NEGATIVE_CERTIFIED
Definition: pipeline_stats.h:70
@ PIT_TRANSACTIONS_LOCAL_ROLLBACK
Definition: pipeline_stats.h:82
@ PIT_MAX
Definition: pipeline_stats.h:91
@ PIT_TRANSACTIONS_WAITING_CERTIFICATION
Definition: pipeline_stats.h:55
@ PIT_TRANSACTION_GTIDS_PRESENT
Definition: pipeline_stats.h:88
@ PIT_TRANSACTIONS_WAITING_APPLY
Definition: pipeline_stats.h:58
@ PIT_TRANSACTIONS_LOCAL
Definition: pipeline_stats.h:67
@ PIT_UNKNOWN
Definition: pipeline_stats.h:52
@ PIT_TRANSACTIONS_ROWS_VALIDATING
Definition: pipeline_stats.h:73
@ PIT_FLOW_CONTROL_MODE
Definition: pipeline_stats.h:85
int32 get_transactions_waiting_certification()
Get transactions waiting certification counter value.
Definition: pipeline_stats.cc:109
Flow_control_mode m_flow_control_mode
Definition: pipeline_stats.h:261
int64 m_transactions_local_rollback
Definition: pipeline_stats.h:260
std::string m_transaction_last_conflict_free
Definition: pipeline_stats.h:259
bool m_transaction_gtids_present
Definition: pipeline_stats.h:257
int32 get_transactions_waiting_apply()
Get transactions waiting apply counter value.
Definition: pipeline_stats.cc:119
int64 m_transactions_applied
Definition: pipeline_stats.h:253
int64 get_transactions_local_rollback()
Get local transactions rolled back by the member.
Definition: pipeline_stats.cc:148
Pipeline_stats_member_message(int32 transactions_waiting_certification, int32 transactions_waiting_apply, int64 transactions_certified, int64 transactions_applied, int64 transactions_local, int64 transactions_negative_certified, int64 transactions_rows_validating, bool transaction_gtids, const std::string &transactions_committed_all_members, const std::string &transactions_last_conflict_free, int64 transactions_local_rollback, Flow_control_mode mode)
Message constructor.
Definition: pipeline_stats.cc:67
int64 get_transactions_negative_certified()
Get negatively certified transaction by member.
Definition: pipeline_stats.cc:134
~Pipeline_stats_member_message() override
Message destructor.
void encode_payload(std::vector< unsigned char > *buffer) const override
Encodes the message contents for transmission.
Definition: pipeline_stats.cc:170
int64 get_transactions_local()
Get local transactions that member tried to commit.
Definition: pipeline_stats.cc:129
int64 get_transactions_certified()
Get transactions certified.
Definition: pipeline_stats.cc:114
std::string m_transactions_committed_all_members
Definition: pipeline_stats.h:258
void decode_payload(const unsigned char *buffer, const unsigned char *end) override
Message decoding method.
Definition: pipeline_stats.cc:227
const std::string & get_transaction_last_conflict_free()
Get last positive certified transaction.
Definition: pipeline_stats.cc:160
int32 m_transactions_waiting_certification
Definition: pipeline_stats.h:250
int32 m_transactions_waiting_apply
Definition: pipeline_stats.h:251
Flow_control_mode get_flow_control_mode()
Get flow-control mode of member.
Definition: pipeline_stats.cc:165
const std::string & get_transaction_committed_all_members()
Get set of stable group transactions.
Definition: pipeline_stats.cc:154
int64 m_transactions_certified
Definition: pipeline_stats.h:252
bool get_transation_gtids_present() const
Returns a flag indicating whether or not the GTIDs on this stats message are updated/present.
Definition: pipeline_stats.cc:144
int64 m_transactions_negative_certified
Definition: pipeline_stats.h:255
int64 m_transactions_local
Definition: pipeline_stats.h:254
int64 get_transactions_applied()
Get transactions applied.
Definition: pipeline_stats.cc:124
int64 get_transactions_rows_validating()
Get size of conflict detection database.
Definition: pipeline_stats.cc:139
This is the base GCS plugin message.
Definition: gcs_plugin_messages.h:64
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
int64_t int64
Definition: my_inttypes.h:68
int32_t int32
Definition: my_inttypes.h:66
uint64_t uint64
Definition: my_inttypes.h:69
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
Definition: buf0block_hint.cc:30
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
mode
Definition: file_handle.h:60
std::map< std::string, Pipeline_member_stats > Flow_control_module_info
Data type that holds all members stats.
Definition: pipeline_stats.h:585
Flow_control_mode
Flow control modes: FCM_DISABLED flow control disabled FCM_QUOTA introduces a delay only on transacti...
Definition: pipeline_stats.h:41
@ FCM_DISABLED
Definition: pipeline_stats.h:41
@ FCM_QUOTA
Definition: pipeline_stats.h:41
An instrumented cond structure.
Definition: mysql_cond_bits.h:50
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:50