Skip to content

Commit 8940029

Browse files
committed
Bug#36569947 Ndb : No way to determine if SHM transporters in use
Add a new type column to the ndbinfo.transporter_details view. This takes values 'TCP' or 'SHM', allowing the transporter types in use to be observed. Column is added as the last in the table which should allow for defined upgrade behaviour. Change-Id: I4cec1a9cdb6d7a84419133178b1b560402222d9c
1 parent d3117e3 commit 8940029

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

mysql-test/suite/ndb/r/ndbinfo_plans.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ndb$acc_operations 15 64
6363
ndb$backup_id 1 20
6464
ndb$blocks 29 20
6565
ndb$certificates 34 44
66-
ndb$columns 560 44
66+
ndb$columns 561 44
6767
ndb$config_nodes 34 28
6868
ndb$counters 200 24
6969
ndb$dblqh_tcconnect_state 19 52
@@ -106,7 +106,7 @@ ndb$threadblocks 124 16
106106
ndb$threads 26 40
107107
ndb$threadstat 22 144
108108
ndb$transactions 5 44
109-
ndb$transporter_details 32 108
109+
ndb$transporter_details 32 112
110110
ndb$transporters 32 68
111111

112112
CALL populate_sizes();

storage/ndb/include/transporter/TransporterRegistry.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ class TransporterRegistry {
545545
Transporter *get_node_base_transporter(NodeId nodeId) const;
546546
Transporter *get_node_transporter_instance(NodeId nodeId, int inst) const;
547547
bool is_shm_transporter(TrpId trp_id);
548+
TransporterType get_transporter_type(TrpId id) const;
548549

549550
ndb_sockaddr get_connect_address_node(NodeId nodeId) const;
550551
ndb_sockaddr get_connect_address(TrpId trpId) const;

storage/ndb/plugin/ha_ndbinfo_sql.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,12 @@ static struct view {
666666
" connect_count, "
667667
" overloaded, overload_count, slowdown, slowdown_count, encrypted, "
668668
" sendbuffer_used_bytes, sendbuffer_max_used_bytes, "
669-
" sendbuffer_alloc_bytes, sendbuffer_max_alloc_bytes "
669+
" sendbuffer_alloc_bytes, sendbuffer_max_alloc_bytes, "
670+
" CASE type"
671+
" WHEN 1 THEN \"TCP\""
672+
" WHEN 3 THEN \"SHM\""
673+
" ELSE NULL "
674+
" END AS type "
670675
"FROM `ndbinfo`.`ndb$transporter_details`"},
671676
{"ndbinfo", "transporters",
672677
"SELECT node_id, remote_node_id, "

storage/ndb/src/common/debugger/NdbinfoTables.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ DECLARE_NDBINFO_TABLE(POOLS, 14) = {
105105
{"resource_id", Ndbinfo::Number, ""},
106106
{"type_id", Ndbinfo::Number, "Record type id within resource"}}};
107107

108-
DECLARE_NDBINFO_TABLE(TRANSPORTER_DETAILS, 18) = {
109-
{"transporter_details", 18, 0,
108+
DECLARE_NDBINFO_TABLE(TRANSPORTER_DETAILS, 19) = {
109+
{"transporter_details", 19, 0,
110110
[](const Ndbinfo::Counts &counts) {
111111
return (counts.data_nodes) * (counts.all_nodes - 1);
112112
},
@@ -139,7 +139,9 @@ DECLARE_NDBINFO_TABLE(TRANSPORTER_DETAILS, 18) = {
139139
{"sendbuffer_alloc_bytes", Ndbinfo::Number64,
140140
"SendBuffer bytes allocated"},
141141
{"sendbuffer_max_alloc_bytes", Ndbinfo::Number64,
142-
"SendBuffer historical max bytes allocated"}}};
142+
"SendBuffer historical max bytes allocated"},
143+
144+
{"type", Ndbinfo::Number, "Transporter type"}}};
143145

144146
DECLARE_NDBINFO_TABLE(TRANSPORTERS, 12) = {
145147
{"transporters", 12, 0,

storage/ndb/src/common/transporter/TransporterRegistry.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3085,6 +3085,11 @@ bool TransporterRegistry::is_shm_transporter(TrpId trp_id) {
30853085
return false;
30863086
}
30873087

3088+
TransporterType TransporterRegistry::get_transporter_type(TrpId trp_id) const {
3089+
assert(trp_id < maxTransporters);
3090+
return allTransporters[trp_id]->getTransporterType();
3091+
}
3092+
30883093
bool TransporterRegistry::is_encrypted_link(TrpId trpId) const {
30893094
return allTransporters[trpId]->is_encrypted();
30903095
}

storage/ndb/src/kernel/blocks/trpman.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ void Trpman::execDBINFO_SCANREQ(Signal *signal) {
524524
row.write_uint64(
525525
globalTransporterRegistry.get_send_buffer_max_alloc_bytes(trpId));
526526

527+
/* Transporter type */
528+
row.write_uint32(globalTransporterRegistry.get_transporter_type(trpId));
529+
527530
ndbinfo_send_row(signal, req, row, rl);
528531
trpId++;
529532
if (rl.need_break(req)) {

0 commit comments

Comments
 (0)