Skip to content

Commit

Permalink
fix(keeper): fix endpoint value too long for column/tag
Browse files Browse the repository at this point in the history
  • Loading branch information
qevolg committed Dec 3, 2024
1 parent fb8a10e commit f1902dd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
6 changes: 3 additions & 3 deletions tools/keeper/api/adapter2.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var adapterLog = log.GetLogger("ADP")
type adapterReqType int

const (
rest adapterReqType = iota // 0 - rest
ws // 1 - ws
rest adapterReqType = iota
ws
)

type Adapter struct {
Expand Down Expand Up @@ -210,7 +210,7 @@ var adapterTableSql = "create stable if not exists `adapter_requests` (" +
"`other_fail` int unsigned, " +
"`query_in_process` int unsigned, " +
"`write_in_process` int unsigned ) " +
"tags (`endpoint` varchar(32), `req_type` tinyint unsigned )"
"tags (`endpoint` varchar(255), `req_type` tinyint unsigned )"

func (a *Adapter) createTable() error {
if a.conn == nil {
Expand Down
6 changes: 3 additions & 3 deletions tools/keeper/api/gen_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ func (gm *GeneralMetric) initColumnSeqMap() error {

func (gm *GeneralMetric) createSTables() error {
var createTableSql = "create stable if not exists taosd_cluster_basic " +
"(ts timestamp, first_ep varchar(100), first_ep_dnode_id INT, cluster_version varchar(20)) " +
"(ts timestamp, first_ep varchar(255), first_ep_dnode_id INT, cluster_version varchar(20)) " +
"tags (cluster_id varchar(50))"

if gm.conn == nil {
Expand All @@ -760,8 +760,8 @@ func (gm *GeneralMetric) createSTables() error {
return err
}

createTableSql = "create stable if not exists taos_slow_sql_detail" +
" (start_ts TIMESTAMP, request_id BIGINT UNSIGNED PRIMARY KEY, query_time INT, code INT, error_info varchar(128), " +
createTableSql = "create stable if not exists taos_slow_sql_detail " +
"(start_ts TIMESTAMP, request_id BIGINT UNSIGNED PRIMARY KEY, query_time INT, code INT, error_info varchar(128), " +
"type TINYINT, rows_num BIGINT, sql varchar(16384), process_name varchar(32), process_id varchar(32)) " +
"tags (db varchar(1024), `user` varchar(32), ip varchar(32), cluster_id varchar(32))"

Expand Down
2 changes: 1 addition & 1 deletion tools/keeper/api/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var dnodeEpLen = strconv.Itoa(255)

var CreateClusterInfoSql = "create table if not exists cluster_info (" +
"ts timestamp, " +
"first_ep binary(134), " +
"first_ep binary(255), " +
"first_ep_dnode_id int, " +
"version binary(12), " +
"master_uptime float, " +
Expand Down
2 changes: 1 addition & 1 deletion tools/keeper/cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func (cmd *Command) TransferTaosdClusterBasicInfo() error {
delta := time.Hour * 24 * 10

var createTableSql = "create stable if not exists taosd_cluster_basic " +
"(ts timestamp, first_ep varchar(100), first_ep_dnode_id INT, cluster_version varchar(20)) " +
"(ts timestamp, first_ep varchar(255), first_ep_dnode_id INT, cluster_version varchar(20)) " +
"tags (cluster_id varchar(50))"

if _, err := cmd.conn.Exec(ctx, createTableSql, util.GetQidOwn()); err != nil {
Expand Down
8 changes: 0 additions & 8 deletions tools/keeper/system/empty_test.go

This file was deleted.

0 comments on commit f1902dd

Please sign in to comment.