24#ifndef PIPELINE_STATS_INCLUDED
25#define PIPELINE_STATS_INCLUDED
128 int32 transactions_waiting_certification,
129 int32 transactions_waiting_apply,
int64 transactions_certified,
130 int64 transactions_applied,
int64 transactions_local,
131 int64 transactions_negative_certified,
int64 transactions_rows_validating,
132 bool transaction_gtids,
133 const std::string &transactions_committed_all_members,
134 const std::string &transactions_last_conflict_free,
262 const unsigned char *
end)
override;
635 const std::string &member_id);
This has the functionality of mysql_rwlock_t, with two differences:
Definition: rpl_gtid.h:324
The pipeline stats aggregator of all group members stats and flow control module.
Definition: pipeline_stats.h:608
Flow_control_module()
Default constructor.
Definition: pipeline_stats.cc:726
Flow_control_module_info m_info
Definition: pipeline_stats.h:668
int seconds_to_skip
Definition: pipeline_stats.h:694
std::atomic< int64 > m_quota_used
Definition: pipeline_stats.h:683
static const int64 MAXTPS
Definition: pipeline_stats.h:610
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:1002
mysql_cond_t m_flow_control_cond
Definition: pipeline_stats.h:666
virtual ~Flow_control_module()
Destructor.
Definition: pipeline_stats.cc:743
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:749
mysql_mutex_t m_flow_control_lock
Definition: pipeline_stats.h:665
std::atomic< int32 > m_holds_in_period
Definition: pipeline_stats.h:678
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:943
uint64 m_stamp
Definition: pipeline_stats.h:689
Pipeline_member_stats * get_pipeline_stats(const std::string &member_id)
Returns copy of individual member stats information.
Definition: pipeline_stats.cc:980
std::atomic< int64 > m_quota_size
Definition: pipeline_stats.h:684
Checkable_rwlock * m_flow_control_module_info_lock
Definition: pipeline_stats.h:672
Computed statistics per member.
Definition: pipeline_stats.h:433
std::string m_transaction_last_conflict_free
Definition: pipeline_stats.h:590
int64 m_delta_transactions_certified
Definition: pipeline_stats.h:582
void set_transaction_committed_all_members(char *str, size_t len)
Set the stable group transactions.
Definition: pipeline_stats.cc:692
Flow_control_mode m_flow_control_mode
Definition: pipeline_stats.h:592
void get_transaction_last_conflict_free(std::string &value)
Get the last positive certified transaction.
Definition: pipeline_stats.cc:697
int64 m_transactions_applied
Definition: pipeline_stats.h:583
uint64 get_stamp()
Get the last stats update stamp.
Definition: pipeline_stats.cc:711
int64 get_transactions_certified()
Get transactions certified counter value.
Definition: pipeline_stats.cc:663
int64 m_delta_transactions_local
Definition: pipeline_stats.h:586
int32 m_transactions_waiting_certification
Definition: pipeline_stats.h:579
void set_transaction_last_conflict_free(std::string &value)
Set the last positive certified transaction.
Definition: pipeline_stats.cc:702
int64 get_transactions_local()
Get local member transactions proposed counter value.
Definition: pipeline_stats.cc:671
int64 get_transactions_negative_certified()
Get transactions negatively certified.
Definition: pipeline_stats.cc:675
std::string m_transactions_committed_all_members
Definition: pipeline_stats.h:589
int64 get_delta_transactions_applied()
Get transactions applied since last stats message.
Definition: pipeline_stats.cc:655
int32 get_transactions_waiting_certification()
Get transactions waiting certification counter value.
Definition: pipeline_stats.cc:643
uint64 m_stamp
Definition: pipeline_stats.h:593
Flow_control_mode get_flow_control_mode()
Get flow_control_mode of a member.
Definition: pipeline_stats.cc:707
int32 get_transactions_waiting_apply()
Get transactions waiting apply counter value.
Definition: pipeline_stats.cc:647
Pipeline_member_stats()
Default constructor.
Definition: pipeline_stats.cc:532
int64 m_transactions_local
Definition: pipeline_stats.h:585
void debug(const char *member, int64 quota_size, int64 quota_used)
Definition: pipeline_stats.cc:714
void get_transaction_committed_all_members(std::string &value)
Get the stable group transactions.
Definition: pipeline_stats.cc:687
int64 m_transactions_negative_certified
Definition: pipeline_stats.h:587
int64 m_transactions_rows_validating
Definition: pipeline_stats.h:588
int64 m_transactions_certified
Definition: pipeline_stats.h:581
int32 m_transactions_waiting_apply
Definition: pipeline_stats.h:580
int64 get_transactions_rows_validating()
Get certification database counter value.
Definition: pipeline_stats.cc:679
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:590
int64 get_delta_transactions_certified()
Get transactions certified since last stats message.
Definition: pipeline_stats.cc:651
int64 m_transactions_local_rollback
Definition: pipeline_stats.h:591
int64 get_delta_transactions_local()
Get local transactions that member tried to commit since last stats message.
Definition: pipeline_stats.cc:659
bool is_flow_control_needed()
Returns true if the node is behind on some user-defined criteria.
Definition: pipeline_stats.cc:635
int64 m_delta_transactions_applied
Definition: pipeline_stats.h:584
int64 get_transactions_local_rollback()
Get local member transactions negatively certified.
Definition: pipeline_stats.cc:683
int64 get_transactions_applied()
Get transactions applied counter value.
Definition: pipeline_stats.cc:667
The pipeline collector for the local member stats.
Definition: pipeline_stats.h:284
int64 get_transactions_local_rollback()
Definition: pipeline_stats.cc:408
void decrement_transactions_waiting_apply()
Decrement transactions waiting apply counter value.
Definition: pipeline_stats.cc:370
std::atomic< uint64 > m_delta_transactions_applied_during_recovery
Definition: pipeline_stats.h:421
void increment_transactions_applied()
Increment transactions applied counter value.
Definition: pipeline_stats.cc:380
std::atomic< int64 > m_transactions_certified
Definition: pipeline_stats.h:412
Pipeline_stats_member_collector()
Default constructor.
Definition: pipeline_stats.cc:336
void clear_transactions_waiting_apply()
Set transactions waiting apply counter to 0.
Definition: pipeline_stats.cc:357
std::atomic< uint64 > m_transactions_certified_during_recovery
Definition: pipeline_stats.h:417
int64 get_transactions_applied()
Definition: pipeline_stats.cc:400
void increment_transactions_certified()
Increment transactions certified counter value.
Definition: pipeline_stats.cc:376
void increment_transactions_local()
Increment local transactions counter value.
Definition: pipeline_stats.cc:384
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:432
void send_stats_member_message(Flow_control_mode mode)
Send member statistics to group.
Definition: pipeline_stats.cc:479
uint64 get_delta_transactions_applied_during_recovery()
Definition: pipeline_stats.cc:441
std::atomic< uint64 > m_transactions_certified_negatively_during_recovery
Definition: pipeline_stats.h:418
std::atomic< int64 > m_transactions_local_rollback
Definition: pipeline_stats.h:415
void increment_transactions_certified_during_recovery()
Increment certified transactions during recovery counter value.
Definition: pipeline_stats.cc:417
std::atomic< int64 > m_transactions_applied
Definition: pipeline_stats.h:413
void increment_transactions_waiting_apply()
Increment transactions waiting apply counter value.
Definition: pipeline_stats.cc:363
mysql_mutex_t m_transactions_waiting_apply_lock
Definition: pipeline_stats.h:425
std::atomic< uint64 > m_transactions_delivered_during_recovery
Definition: pipeline_stats.h:422
uint64 get_transactions_waiting_apply_during_recovery()
Definition: pipeline_stats.cc:446
void increment_transactions_certified_negatively_during_recovery()
Increment negatively certified transactions during recovery counter value.
Definition: pipeline_stats.cc:422
int32 get_transactions_waiting_apply()
Definition: pipeline_stats.cc:392
uint64 m_previous_transactions_applied_during_recovery
Definition: pipeline_stats.h:420
uint64 get_transactions_waiting_certification_during_recovery()
Definition: pipeline_stats.cc:472
void increment_transactions_applied_during_recovery()
Increment local recovery transactions counter value.
Definition: pipeline_stats.cc:427
void increment_transactions_local_rollback()
Increment local rollback transactions counter value.
Definition: pipeline_stats.cc:388
int64 get_transactions_local()
Definition: pipeline_stats.cc:404
bool send_transaction_identifiers
Definition: pipeline_stats.h:424
void set_send_transaction_identifiers()
Send Transaction Identifiers or not.
Definition: pipeline_stats.cc:412
std::atomic< int64 > m_transactions_local
Definition: pipeline_stats.h:414
std::atomic< int32 > m_transactions_waiting_apply
Definition: pipeline_stats.h:411
int64 get_transactions_certified()
Definition: pipeline_stats.cc:396
std::atomic< uint64 > m_transactions_applied_during_recovery
Definition: pipeline_stats.h:419
void increment_transactions_delivered_during_recovery()
Increment delivered transactions during recovery counter value.
Definition: pipeline_stats.cc:467
virtual ~Pipeline_stats_member_collector()
Destructor.
Definition: pipeline_stats.cc:353
Describes all statistics sent by members.
Definition: pipeline_stats.h:48
int64 m_transactions_rows_validating
Definition: pipeline_stats.h:271
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:94
@ 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_SENT_TIMESTAMP
Definition: pipeline_stats.h:91
@ 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:110
Flow_control_mode m_flow_control_mode
Definition: pipeline_stats.h:276
int64 m_transactions_local_rollback
Definition: pipeline_stats.h:275
std::string m_transaction_last_conflict_free
Definition: pipeline_stats.h:274
bool m_transaction_gtids_present
Definition: pipeline_stats.h:272
int32 get_transactions_waiting_apply()
Get transactions waiting apply counter value.
Definition: pipeline_stats.cc:120
int64 m_transactions_applied
Definition: pipeline_stats.h:268
int64 get_transactions_local_rollback()
Get local transactions rolled back by the member.
Definition: pipeline_stats.cc:149
static uint64_t get_sent_timestamp(const unsigned char *buffer, size_t length)
Return the time at which the message contained in the buffer was sent.
Definition: pipeline_stats.cc:329
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:68
int64 get_transactions_negative_certified()
Get negatively certified transaction by member.
Definition: pipeline_stats.cc:135
~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:171
int64 get_transactions_local()
Get local transactions that member tried to commit.
Definition: pipeline_stats.cc:130
int64 get_transactions_certified()
Get transactions certified.
Definition: pipeline_stats.cc:115
std::string m_transactions_committed_all_members
Definition: pipeline_stats.h:273
void decode_payload(const unsigned char *buffer, const unsigned char *end) override
Message decoding method.
Definition: pipeline_stats.cc:231
const std::string & get_transaction_last_conflict_free()
Get last positive certified transaction.
Definition: pipeline_stats.cc:161
int32 m_transactions_waiting_certification
Definition: pipeline_stats.h:265
int32 m_transactions_waiting_apply
Definition: pipeline_stats.h:266
Flow_control_mode get_flow_control_mode()
Get flow-control mode of member.
Definition: pipeline_stats.cc:166
const std::string & get_transaction_committed_all_members()
Get set of stable group transactions.
Definition: pipeline_stats.cc:155
int64 m_transactions_certified
Definition: pipeline_stats.h:267
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:145
int64 m_transactions_negative_certified
Definition: pipeline_stats.h:270
int64 m_transactions_local
Definition: pipeline_stats.h:269
int64 get_transactions_applied()
Get transactions applied.
Definition: pipeline_stats.cc:125
int64 get_transactions_rows_validating()
Get size of conflict detection database.
Definition: pipeline_stats.cc:140
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:1081
Definition: buf0block_hint.cc:30
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
mode
Definition: file_handle.h:61
std::map< std::string, Pipeline_member_stats > Flow_control_module_info
Data type that holds all members stats.
Definition: pipeline_stats.h:600
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