Skip to content

Commit bc05ac9

Browse files
committed
WL#15154 patch #6 Add "encrypted" column to ndbinfo.transporters
This patch exposes the transporter-level encrypted flag for publication in ndbinfo.transporters. Change-Id: I7bab7d437aaae001c4d4298ef9f827632401785f
1 parent 8c9b493 commit bc05ac9

File tree

12 files changed

+48
-7
lines changed

12 files changed

+48
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ SELECT COUNT(*) FROM ndb$tables t, ndb$columns c
153153
WHERE t.table_id = c.table_id AND
154154
t.table_id in (1,2,3,4,5,6);
155155
COUNT(*)
156-
49
156+
50
157157

158158
SELECT table_id, table_name, comment from ndb$tables
159159
WHERE table_id > 2 AND table_id <= 5 ORDER BY table_id;

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 535 44
66+
ndb$columns 536 44
6767
ndb$config_nodes 34 28
6868
ndb$counters 200 24
6969
ndb$dblqh_tcconnect_state 19 52
@@ -105,7 +105,7 @@ ndb$threadblocks 124 16
105105
ndb$threads 26 40
106106
ndb$threadstat 22 144
107107
ndb$transactions 5 44
108-
ndb$transporters 32 64
108+
ndb$transporters 32 68
109109

110110
CALL populate_sizes();
111111

mysql-test/suite/ndb_tls/sign_keys.result

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
SELECT 1;
22
1
33
1
4+
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
5+
ORDER BY node_id;
6+
node_id remote_node_id encrypted
7+
1 2 0
8+
1 3 0
9+
1 51 0
10+
1 52 0
11+
1 53 0
12+
1 54 0
13+
2 1 0
14+
2 3 0
15+
2 51 0
16+
2 52 0
17+
2 53 0
18+
2 54 0
419
ndb-api-cert
520
ndb-api-private-key
621
ndb-data-node-cert

mysql-test/suite/ndb_tls/sign_keys.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# The MySQL server is up
1313
SELECT 1;
1414

15+
# Look at the transporters table
16+
SELECT node_id, remote_node_id, encrypted from ndbinfo.transporters
17+
ORDER BY node_id;
18+
1519
# On startup, none of the files exist
1620
--error 1
1721
--file_exists $MYSQLTEST_VARDIR/mysql_cluster.1/NDB-Cluster-cert

storage/ndb/include/transporter/TransporterRegistry.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ class TransporterRegistry
552552
Transporter* get_node_transporter(NodeId nodeId) const;
553553
bool is_shm_transporter(NodeId nodeId);
554554
ndb_sockaddr get_connect_address(NodeId node_id) const;
555+
bool is_encrypted_link(NodeId) const;
555556

556557
Uint64 get_bytes_sent(NodeId nodeId) const;
557558
Uint64 get_bytes_received(NodeId nodeId) const;

storage/ndb/plugin/ha_ndbinfo_sql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static struct view {
660660
" END AS status, "
661661
" remote_address, bytes_sent, bytes_received, "
662662
" connect_count, "
663-
" overloaded, overload_count, slowdown, slowdown_count "
663+
" overloaded, overload_count, slowdown, slowdown_count, encrypted "
664664
"FROM `ndbinfo`.`ndb$transporters`"},
665665
};
666666

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ DECLARE_NDBINFO_TABLE(POOLS,14) =
114114
}
115115
};
116116

117-
DECLARE_NDBINFO_TABLE(TRANSPORTERS, 11) =
118-
{ { "transporters", 11, 0,
117+
DECLARE_NDBINFO_TABLE(TRANSPORTERS, 12) =
118+
{ { "transporters", 12, 0,
119119
[] (const Ndbinfo::Counts &counts) {
120120
return (counts.data_nodes) * (counts.all_nodes - 1); },
121121
"transporter status" },
@@ -135,7 +135,8 @@ DECLARE_NDBINFO_TABLE(TRANSPORTERS, 11) =
135135
{"overload_count", Ndbinfo::Number, "Number of overload onsets since connect"},
136136

137137
{"slowdown", Ndbinfo::Number, "Is link requesting slowdown"},
138-
{"slowdown_count", Ndbinfo::Number, "Number of slowdown onsets since connect"}
138+
{"slowdown_count", Ndbinfo::Number, "Number of slowdown onsets since connect"},
139+
{"encrypted", Ndbinfo::Number, "Is link using TLS encryption"}
139140
}
140141
};
141142

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,10 @@ Multi_Transporter::switch_active_trp()
202202
}
203203
m_num_inactive_transporters = save_num_active_transporters;
204204
}
205+
206+
bool
207+
Multi_Transporter::is_encrypted() const {
208+
if(m_num_active_transporters)
209+
return m_active_transporters[0]->is_encrypted();
210+
return false;
211+
}

storage/ndb/src/common/transporter/Multi_Transporter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ class Multi_Transporter : public Transporter {
103103
return m_inactive_transporters[index];
104104
}
105105

106+
bool is_encrypted() const override;
107+
106108
private:
107109
/**
108110
* Allocate buffers for sending and receiving

storage/ndb/src/common/transporter/Transporter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class Transporter {
195195
Uint32 get_max_send_buffer() { return m_max_send_buffer; }
196196

197197
Uint32 get_connect_count() { return m_connect_count; }
198+
virtual bool is_encrypted() const { return m_encrypted; }
198199

199200
void inc_overload_count() { m_overload_count++; }
200201
Uint32 get_overload_count() { return m_overload_count; }

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3738,6 +3738,12 @@ TransporterRegistry::is_shm_transporter(TrpId trp_id)
37383738
return false;
37393739
}
37403740

3741+
bool
3742+
TransporterRegistry::is_encrypted_link(NodeId nodeId) const
3743+
{
3744+
return theNodeIdTransporters[nodeId]->is_encrypted();
3745+
}
3746+
37413747
Transporter*
37423748
TransporterRegistry::get_transporter(TrpId trp_id) const
37433749
{

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ Trpman::execDBINFO_SCANREQ(Signal *signal)
565565
row.write_uint32(globalTransporterRegistry.get_overload_count(rnode));
566566
row.write_uint32(globalTransporterRegistry.get_status_slowdown().get(rnode));
567567
row.write_uint32(globalTransporterRegistry.get_slowdown_count(rnode));
568+
569+
/* TLS */
570+
row.write_uint32(globalTransporterRegistry.is_encrypted_link(rnode));
571+
568572
ndbinfo_send_row(signal, req, row, rl);
569573
break;
570574
}

0 commit comments

Comments
 (0)