Skip to content

Commit 8d4f7ff

Browse files
hermanleeHerman Lee
authored andcommitted
Fix semi_sync histogram reporting
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
1 parent 04ddd79 commit 8d4f7ff

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugin/semisync/semisync_source.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,11 @@ void ReplSemiSyncMaster::setExportStats() {
12061206
((double)rpl_semi_sync_source_net_wait_num))
12071207
: 0);
12081208

1209+
for (size_t i_bins = 0; i_bins < NUMBER_OF_HISTOGRAM_BINS; ++i_bins) {
1210+
histogram_trx_wait_values[i_bins] =
1211+
latency_histogram_get_count(&histogram_trx_wait, i_bins);
1212+
}
1213+
12091214
unlock();
12101215
}
12111216

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

1228-
for (size_t i_bins = 0; i_bins < NUMBER_OF_HISTOGRAM_BINS; ++i_bins) {
1229-
histogram_trx_wait_values[i_bins] =
1230-
latency_histogram_get_count(&histogram_trx_wait, i_bins);
1231-
}
1232-
12331233
unlock();
12341234
return function_exit(kWho, result);
12351235
}

0 commit comments

Comments
 (0)