Skip to content

Commit

Permalink
Fix semi_sync histogram reporting
Browse files Browse the repository at this point in the history
Summary:
Fix a porting bug with semi_sync histograms.

Squash with D21832889

Test Plan:
Verify histogram reporting

```
mysql> show global status like 'rpl_semi_sync_master%';
+---------------------------------------------------------+-------+
| Variable_name                                           | Value |
+---------------------------------------------------------+-------+
| Rpl_semi_sync_master_clients                            | 1     |
| Rpl_semi_sync_master_net_avg_wait_time                  | 0     |
| Rpl_semi_sync_master_net_wait_time                      | 0     |
| Rpl_semi_sync_master_net_waits                          | 3     |
| Rpl_semi_sync_master_no_times                           | 0     |
| Rpl_semi_sync_master_no_tx                              | 0     |
| Rpl_semi_sync_master_status                             | ON    |
| Rpl_semi_sync_master_timefunc_failures                  | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_0-500us         | 3     |
| Rpl_semi_sync_master_trx_wait_histogram_500-1500us      | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_1500-3500us     | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_3500-7500us     | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_7500-15500us    | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_15500-31500us   | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_31500-63500us   | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_63500-127500us  | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_127500-255500us | 0     |
| Rpl_semi_sync_master_trx_wait_histogram_255500-MAXus    | 0     |
| Rpl_semi_sync_master_tx_avg_wait_time                   | 769   |
| Rpl_semi_sync_master_tx_wait_time                       | 2308  |
| Rpl_semi_sync_master_tx_waits                           | 3     |
| Rpl_semi_sync_master_wait_pos_backtraverse              | 0     |
| Rpl_semi_sync_master_wait_sessions                      | 0     |
| Rpl_semi_sync_master_yes_tx                             | 3     |
+---------------------------------------------------------+-------+
24 rows in set (0.00 sec)
```

Reviewers: luqun, mung, yoshinori, junyilu, greynya

Reviewed By: greynya

Subscribers: pgl, webscalesql-eng@fb.com

Differential Revision: https://phabricator.intern.facebook.com/D40964563
  • Loading branch information
hermanlee authored and Herman Lee committed Nov 3, 2022
1 parent 04ddd79 commit 8d4f7ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/semisync/semisync_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,11 @@ void ReplSemiSyncMaster::setExportStats() {
((double)rpl_semi_sync_source_net_wait_num))
: 0);

for (size_t i_bins = 0; i_bins < NUMBER_OF_HISTOGRAM_BINS; ++i_bins) {
histogram_trx_wait_values[i_bins] =
latency_histogram_get_count(&histogram_trx_wait, i_bins);
}

unlock();
}

Expand All @@ -1225,11 +1230,6 @@ int ReplSemiSyncMaster::setWaitSlaveCount(unsigned int new_value) {
reportReplyBinlog(ackinfo->binlog_name, ackinfo->binlog_pos);
}

for (size_t i_bins = 0; i_bins < NUMBER_OF_HISTOGRAM_BINS; ++i_bins) {
histogram_trx_wait_values[i_bins] =
latency_histogram_get_count(&histogram_trx_wait, i_bins);
}

unlock();
return function_exit(kWho, result);
}
Expand Down

0 comments on commit 8d4f7ff

Please sign in to comment.