Skip to content

Commit 2f7a94c

Browse files
authored
Merge pull request #1560 from dcherednik/node_id_describe_support
Added option to get shard nodeId for describe table call
2 parents d4f0156 + 0640970 commit 2f7a94c

File tree

11 files changed

+20
-10
lines changed

11 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Added `table/options.WithShardNodesInfo()` experimental option to get shard nodeId for describe table call
2+
13
## v3.92.1
24
* Added `sugar.WithUserPassword(user,password)` option for `sugar.DSN()` helper
35
* Added `sugar.WithSecure(bool)` option for `sugar.DSN()` helper

examples/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ require (
5151
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
5252
github.com/syndtr/goleveldb v1.0.0 // indirect
5353
github.com/yandex-cloud/go-genproto v0.0.0-20220815090733-4c139c0154e2 // indirect
54-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b // indirect
54+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77 // indirect
5555
github.com/ydb-platform/ydb-go-yc-metadata v0.6.1 // indirect
5656
golang.org/x/crypto v0.24.0 // indirect
5757
golang.org/x/mod v0.17.0 // indirect

examples/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,8 +1840,8 @@ github.com/ydb-platform/gorm-driver v0.1.3 h1:uewwScbRuCixNPC0LF7gDKvWcB13/iLj76
18401840
github.com/ydb-platform/gorm-driver v0.1.3/go.mod h1:49cSoG5J18muQTiKj4StL2dHs1/dB94OitnHOvetK24=
18411841
github.com/ydb-platform/xorm v0.0.3 h1:MXk42lANB6r/MMLg/XdJfyXJycGUDlCeLiMlLGDKVPw=
18421842
github.com/ydb-platform/xorm v0.0.3/go.mod h1:hFsU7EUF0o3S+l5c0eyP2yPVjJ0d4gsFdqCsyazzwBc=
1843-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b h1:8yiv/W+1xTdifJh1Stkck0gFJjys9kg0/r86Buljuss=
1844-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I=
1843+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77 h1:LY6cI8cP4B9rrpTleZk95+08kl2gF4rixG7+V/dwL6Q=
1844+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I=
18451845
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.3.0 h1:JxSvw+Moont8qCmibP2MjSEIHfkWJLkw0fHZemAk+d0=
18461846
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.3.0/go.mod h1:YzCPoNrTbrXZg9bO2YkbjI6eQLkaRIE9Bq8ponu0g8A=
18471847
github.com/ydb-platform/ydb-go-sdk-prometheus/v2 v2.0.1 h1:Lsir3AC2VQOTlp8UjZY9zQdCVfWvBNHT3hZn+jSGoo0=

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/golang-jwt/jwt/v4 v4.4.1
77
github.com/google/uuid v1.6.0
88
github.com/jonboulle/clockwork v0.3.0
9-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b
9+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77
1010
golang.org/x/net v0.23.0
1111
golang.org/x/sync v0.6.0
1212
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
6565
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
6666
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
6767
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
68-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b h1:8yiv/W+1xTdifJh1Stkck0gFJjys9kg0/r86Buljuss=
69-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I=
68+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77 h1:LY6cI8cP4B9rrpTleZk95+08kl2gF4rixG7+V/dwL6Q=
69+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77/go.mod h1:Er+FePu1dNUieD+XTMDduGpQuCPssK5Q4BjF+IIXJ3I=
7070
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
7171
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
7272
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=

internal/grpcwrapper/rawtopic/controlplane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (s *PartitioningSettings) FromProto(proto *Ydb_Topic.PartitioningSettings)
5757
}
5858

5959
s.MinActivePartitions = proto.GetMinActivePartitions()
60-
s.PartitionCountLimit = proto.GetPartitionCountLimit()
60+
s.PartitionCountLimit = proto.GetPartitionCountLimit() //nolint:staticcheck
6161

6262
return nil
6363
}

internal/table/session.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ func processTableStats(resStats *Ydb_Table.TableStats) *options.TableStats {
418418
for i, v := range resStats.GetPartitionStats() {
419419
partStats[i].RowsEstimate = v.GetRowsEstimate()
420420
partStats[i].StoreSize = v.GetStoreSize()
421+
partStats[i].LeaderNodeID = v.GetLeaderNodeId()
421422
}
422423

423424
var creationTime, modificationTime time.Time

table/options/models.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type TableStats struct {
7373
type PartitionStats struct {
7474
RowsEstimate uint64
7575
StoreSize uint64
76+
LeaderNodeID uint32
7677
}
7778

7879
type ColumnFamily struct {

table/options/options.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ func WithPartitionStats() DescribeTableOption {
2828
}
2929
}
3030

31+
func WithShardNodesInfo() DescribeTableOption {
32+
return func(d *DescribeTableDesc) {
33+
d.IncludeShardNodesInfo = true
34+
}
35+
}
36+
3137
type (
3238
CreateTableDesc Ydb_Table.CreateTableRequest
3339
CreateTableOption interface {

tests/slo/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
github.com/prometheus/procfs v0.8.0 // indirect
3535
github.com/syndtr/goleveldb v1.0.0 // indirect
3636
github.com/yandex-cloud/go-genproto v0.0.0-20211115083454-9ca41db5ed9e // indirect
37-
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241022174402-dd276c7f197b // indirect
37+
github.com/ydb-platform/ydb-go-genproto v0.0.0-20241112172322-ea1f63298f77 // indirect
3838
github.com/ydb-platform/ydb-go-yc v0.12.1 // indirect
3939
github.com/ydb-platform/ydb-go-yc-metadata v0.6.1 // indirect
4040
golang.org/x/net v0.26.0 // indirect

0 commit comments

Comments
 (0)