Skip to content

Commit

Permalink
server: deprecate database and index fields on HotRanges proto
Browse files Browse the repository at this point in the history
In changeset #134106, the database, table, and index fields of the
HotRanges protobuf were moved to synonymous keys so that there could be
multiple of each. This means a hot range could now have multiple
indexes, tables and databases contained within it in the UI.

During this change however, only the old table key of the protobuf was
deprecated, the database and index fields were not flagged for
deprecation. This small change fixes this oversight.

Release note: None
  • Loading branch information
angles-n-daemons committed Dec 18, 2024
1 parent 85afe78 commit d00c8c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
12 changes: 6 additions & 6 deletions pkg/server/api_v2_ranges.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ type hotRangeInfo struct {
ReadBytesPerSecond float64 `json:"read_bytes_per_second"`
CPUTimePerSecond float64 `json:"cpu_time_per_second"`
LeaseholderNodeID roachpb.NodeID `json:"leaseholder_node_id"`
TableName string `json:"table_name"`
DatabaseName string `json:"database_name"`
IndexName string `json:"index_name"`
Databases []string `json:"databases"`
Tables []string `json:"tables"`
Indexes []string `json:"indexes"`
SchemaName string `json:"schema_name"`
ReplicaNodeIDs []roachpb.NodeID `json:"replica_node_ids"`
StoreID roachpb.StoreID `json:"store_id"`
Expand Down Expand Up @@ -516,9 +516,9 @@ func (a *apiV2Server) listHotRanges(w http.ResponseWriter, r *http.Request) {
ReadBytesPerSecond: r.ReadBytesPerSecond,
CPUTimePerSecond: r.CPUTimePerSecond,
LeaseholderNodeID: r.LeaseholderNodeID,
TableName: r.TableName,
DatabaseName: r.DatabaseName,
IndexName: r.IndexName,
Databases: r.Databases,
Tables: r.Tables,
Indexes: r.Indexes,
ReplicaNodeIDs: r.ReplicaNodeIds,
SchemaName: r.SchemaName,
StoreID: r.StoreID,
Expand Down
8 changes: 2 additions & 6 deletions pkg/server/serverpb/status.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1481,12 +1481,6 @@ message HotRangesResponseV2 {
double qps = 3 [
(gogoproto.customname) = "QPS"
];
// table_name has been deprecated in favor of tables = 16;
string table_name = 4 [deprecated = true];
// database_name has been deprecated in favor of databases = 17;
string database_name = 5;
// index_name has been deprecated in favor of indexes = 17;
string index_name = 6;
// replica_node_ids specifies the list of node ids that contain replicas with current hot range.
repeated int32 replica_node_ids = 7 [
(gogoproto.casttype) =
Expand Down Expand Up @@ -1527,6 +1521,8 @@ message HotRangesResponseV2 {
repeated string tables = 17;
// Indexes for the range
repeated string indexes = 18;
// previously used
reserved 4 to 6;
}
// Ranges contain list of hot ranges info that has highest number of QPS.
repeated HotRange ranges = 1;
Expand Down
3 changes: 0 additions & 3 deletions pkg/server/structlogging/hot_ranges_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ func (s *hotRangesLoggingScheduler) start(ctx context.Context, stopper *stop.Sto
hrEvent := &eventpb.HotRangesStats{
RangeID: int64(r.RangeID),
Qps: r.QPS,
DatabaseName: r.DatabaseName,
SchemaName: r.SchemaName,
TableName: r.TableName,
IndexName: r.IndexName,
CPUTimePerSecond: r.CPUTimePerSecond,
ReadBytesPerSecond: r.ReadBytesPerSecond,
WriteBytesPerSecond: r.WriteBytesPerSecond,
Expand Down

0 comments on commit d00c8c9

Please sign in to comment.