Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ linters:
depguard:
rules:
main:
list-mode: lax
files:
- $all
- '!$test'
# allow:
# - $gostd
# - github.com
deny:
- pkg: github.com/OpenPeeDeeP/depguard
desc: example to deny some package
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ fmt:

.PHONY: install-static-check-tools
install-static-check-tools:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOPATH)/bin v2.1.6
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOPATH)/bin v2.6.2
@go install github.com/matrixorigin/linter/cmd/molint@latest
@go install github.com/apache/skywalking-eyes/cmd/[email protected]

Expand All @@ -568,7 +568,7 @@ static-check: config err-check
$(CGO_OPTS) go vet -vettool=`which molint` ./...
$(CGO_OPTS) license-eye -c .licenserc.yml header check
$(CGO_OPTS) license-eye -c .licenserc.yml dep check
$(CGO_OPTS) golangci-lint run -c .golangci.yml ./...
$(CGO_OPTS) golangci-lint run -v -c .golangci.yml ./...

fmtErrs := $(shell grep -onr 'fmt.Errorf' pkg/ --exclude-dir=.git --exclude-dir=vendor \
--exclude=*.pb.go --exclude=system_vars.go --exclude=Makefile)
Expand Down
1 change: 0 additions & 1 deletion cmd/mo-service/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

//go:build service_test
// +build service_test

package main

Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/matrixorigin/matrixone

// Minimum Go version required
go 1.24.3
go 1.25.4

require (
github.com/BurntSushi/toml v1.2.1
Expand Down Expand Up @@ -242,3 +242,5 @@ replace (
github.com/lni/goutils v1.3.1-0.20220604063047-388d67b4dbc4 => github.com/matrixorigin/goutils v1.3.1-0.20220604063047-388d67b4dbc4
github.com/lni/vfs v0.2.1-0.20220616104132-8852fd867376 => github.com/matrixorigin/vfs v0.2.1-0.20220616104132-8852fd867376
)

replace github.com/shoenig/go-m1cpu => github.com/shoenig/go-m1cpu v0.1.7
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
Expand Down Expand Up @@ -748,10 +747,10 @@ github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh
github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM=
github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/shoenig/go-m1cpu v0.1.7 h1:C76Yd0ObKR82W4vhfjZiCp0HxcSZ8Nqd84v+HZ0qyI0=
github.com/shoenig/go-m1cpu v0.1.7/go.mod h1:KkDOw6m3ZJQAPHbrzkZki4hnx+pDRR1Lo+ldA56wD5w=
github.com/shoenig/test v1.7.0 h1:eWcHtTXa6QLnBvm0jgEabMRN/uJ4DMV3M8xUGgRkZmk=
github.com/shoenig/test v1.7.0/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI=
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down
2 changes: 1 addition & 1 deletion optools/bvt_ut/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matrixorigin/tester:go1.24-jdk8
FROM matrixorigin/tester:go1.25.4-jdk8

ARG GOPROXY="https://proxy.golang.org,direct"

Expand Down
2 changes: 1 addition & 1 deletion optools/compose_bvt/Dockerfile.tester
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matrixorigin/tester:go1.24-jdk8
FROM matrixorigin/tester:go1.25.4-jdk8

WORKDIR /

Expand Down
2 changes: 1 addition & 1 deletion optools/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM matrixorigin/golang:1.24-ubuntu22.04 AS builder
FROM matrixorigin/golang:1.25-ubuntu22.04 AS builder

# goproxy
ARG GOPROXY="https://proxy.golang.org,direct"
Expand Down
58 changes: 58 additions & 0 deletions pkg/bootstrap/versions/v4_0_0/cluster_upgrade_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import (
var clusterUpgEntries = []versions.UpgradeEntry{
upg_mo_iscp_task,
upg_create_mo_branch_metadata,
upg_rename_system_stmt_info_4000,
upg_create_system_stmt_info_4000,
upg_rename_system_metrics_metric_4000,
upg_create_system_metrics_metric_4000,
}

var upg_mo_iscp_task = versions.UpgradeEntry{
Expand All @@ -48,3 +52,57 @@ var upg_create_mo_branch_metadata = versions.UpgradeEntry{
return exist, err
},
}

const MO_STATEMENT_4000 = "statement_info_4000"
const RenameStmtInfo_4000 = "ALTER TABLE `system`.`statement_info` RENAME `system`.`statement_info_4000`;"

const CreateStmtInfo_4000 = "CREATE TABLE `system`.`statement_info` (\n `statement_id` varchar(36) NOT NULL COMMENT 'statement uniq id',\n `transaction_id` varchar(36) NOT NULL COMMENT 'txn uniq id',\n `session_id` varchar(36) NOT NULL COMMENT 'session uniq id',\n `account` varchar(1024) NOT NULL COMMENT 'account name',\n `account_id` int unsigned DEFAULT '0' COMMENT 'account id',\n `user` varchar(1024) NOT NULL COMMENT 'user name',\n `host` varchar(1024) NOT NULL COMMENT 'user client ip',\n `database` varchar(1024) NOT NULL COMMENT 'what database current session stay in.',\n `statement` text NOT NULL COMMENT 'sql statement',\n `statement_tag` text NOT NULL COMMENT 'note tag in statement(Reserved)',\n `statement_fingerprint` text NOT NULL COMMENT 'note tag in statement(Reserved)',\n `node_uuid` varchar(36) NOT NULL COMMENT 'node uuid, which node gen this data.',\n `node_type` varchar(1024) NOT NULL COMMENT 'node type in MO, val in [DN, CN, LOG]',\n `request_at` datetime(6) NOT NULL COMMENT 'request accept datetime',\n `response_at` datetime(6) NOT NULL COMMENT 'response send datetime',\n `duration` bigint unsigned DEFAULT '0' COMMENT 'exec time, unit: ns',\n `status` varchar(1024) NOT NULL COMMENT 'sql statement running status, enum: Running, Success, Failed',\n `err_code` varchar(1024) DEFAULT '0' COMMENT 'error code info',\n `error` text NOT NULL COMMENT 'error message',\n `exec_plan` text DEFAULT '{}' COMMENT 'statement execution plan',\n `rows_read` bigint DEFAULT '0' COMMENT 'rows read total',\n `bytes_scan` bigint DEFAULT '0' COMMENT 'bytes scan total',\n `stats` text DEFAULT '[]' COMMENT 'global stats info in exec_plan',\n `statement_type` varchar(1024) NOT NULL COMMENT 'statement type, val in [Insert, Delete, Update, Drop Table, Drop User, ...]',\n `query_type` varchar(1024) NOT NULL COMMENT 'query type, val in [DQL, DDL, DML, DCL, TCL]',\n `role_id` bigint DEFAULT '0' COMMENT 'role id',\n `sql_source_type` text NOT NULL COMMENT 'sql statement source type',\n `aggr_count` bigint DEFAULT '0' COMMENT 'the number of statements aggregated',\n `result_count` bigint DEFAULT '0' COMMENT 'the number of rows of sql execution results',\n `connection_id` bigint DEFAULT '0' COMMENT 'connection id',\n `cu` double DEFAULT '0.0' COMMENT 'cu cost'\n) COMMENT='record each statement and stats info[mo_no_del_hint]' CLUSTER BY (`request_at`, `account_id`)"

// upg_rename_system_stmt_info_4000 do rename table
var upg_rename_system_stmt_info_4000 = versions.UpgradeEntry{
Schema: catalog.MO_SYSTEM,
TableName: catalog.MO_STATEMENT,
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: RenameStmtInfo_4000,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
return versions.CheckTableDefinition(txn, accountId, catalog.MO_SYSTEM, MO_STATEMENT_4000)
},
}

// upg_create_system_stmt_info_4000 do create new table
var upg_create_system_stmt_info_4000 = versions.UpgradeEntry{
Schema: catalog.MO_SYSTEM,
TableName: catalog.MO_STATEMENT,
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: CreateStmtInfo_4000,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
return versions.CheckTableDefinition(txn, accountId, catalog.MO_SYSTEM, catalog.MO_STATEMENT)
},
}

const MO_METRIC_4000 = "metric_4000"
const RenameMetric_4000 = "ALTER TABLE `system_metrics`.`metric` RENAME `system_metrics`.`metric_4000`;"

const CreateMetric_4000 = "CREATE TABLE `system_metrics`.`metric` (\n `metric_name` varchar(1024) DEFAULT 'sys' COMMENT 'metric name, like: sql_statement_total, server_connections, process_cpu_percent, sys_memory_used, ...',\n `collecttime` datetime(6) NOT NULL COMMENT 'metric data collect time',\n `value` double DEFAULT '0.0' COMMENT 'metric value',\n `node` varchar(1024) DEFAULT 'monolithic' COMMENT 'mo node uuid',\n `role` varchar(1024) DEFAULT 'monolithic' COMMENT 'mo node role, like: CN, DN, LOG',\n `account` varchar(1024) DEFAULT 'sys' COMMENT 'account name',\n `account_id` int unsigned DEFAULT '0' COMMENT 'account id',\n `type` varchar(1024) NOT NULL COMMENT 'sql type, like: insert, select, ...'\n) COMMENT='metric data' CLUSTER BY (`collecttime`, `account_id`, `metric_name`)"

// upg_rename_system_metrics_metric_4000 do rename table
var upg_rename_system_metrics_metric_4000 = versions.UpgradeEntry{
Schema: catalog.MO_SYSTEM_METRICS,
TableName: catalog.MO_METRIC,
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: RenameMetric_4000,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
return versions.CheckTableDefinition(txn, accountId, catalog.MO_SYSTEM_METRICS, MO_METRIC_4000)
},
}

// upg_create_system_metrics_metric_4000 do create new table
var upg_create_system_metrics_metric_4000 = versions.UpgradeEntry{
Schema: catalog.MO_SYSTEM_METRICS,
TableName: catalog.MO_METRIC,
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: CreateMetric_4000,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
return versions.CheckTableDefinition(txn, accountId, catalog.MO_SYSTEM_METRICS, catalog.MO_METRIC)
},
}
4 changes: 2 additions & 2 deletions pkg/bootstrap/versions/v4_0_0/tenant_upgrade_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var enablePartitionMetadata = versions.UpgradeEntry{
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: partitionservice.PartitionTableMetadataSQL,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
exist, err := versions.CheckTableDefinition(txn, accountId, catalog.MO_CATALOG, partitionservice.PartitionTableMetadataSQL)
exist, err := versions.CheckTableDefinition(txn, accountId, catalog.MO_CATALOG, catalog.MOPartitionMetadata)
return exist, err
},
}
Expand All @@ -43,7 +43,7 @@ var enablePartitionTables = versions.UpgradeEntry{
UpgType: versions.CREATE_NEW_TABLE,
UpgSql: partitionservice.PartitionTablesSQL,
CheckFunc: func(txn executor.TxnExecutor, accountId uint32) (bool, error) {
exist, err := versions.CheckTableDefinition(txn, accountId, catalog.MO_CATALOG, partitionservice.PartitionTablesSQL)
exist, err := versions.CheckTableDefinition(txn, accountId, catalog.MO_CATALOG, catalog.MOPartitionTables)
return exist, err
},
}
Loading
Loading