Skip to content

Commit e4289fc

Browse files
committed
fix require in lambdas
1 parent b053d31 commit e4289fc

File tree

8 files changed

+130
-98
lines changed

8 files changed

+130
-98
lines changed

internal/coordination/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (c *Client) CreateNode(ctx context.Context, path string, config coordinatio
4545
if !c.config.AutoRetry() {
4646
return call(ctx)
4747
}
48-
return retry.Retry(ctx, call, retry.WithStackTrace())
48+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
4949
}
5050

5151
func (c *Client) createNode(ctx context.Context, path string, config coordination.NodeConfig) (err error) {
@@ -82,7 +82,7 @@ func (c *Client) AlterNode(ctx context.Context, path string, config coordination
8282
if !c.config.AutoRetry() {
8383
return call(ctx)
8484
}
85-
return retry.Retry(ctx, call, retry.WithStackTrace())
85+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
8686
}
8787

8888
func (c *Client) alterNode(ctx context.Context, path string, config coordination.NodeConfig) (err error) {
@@ -119,7 +119,7 @@ func (c *Client) DropNode(ctx context.Context, path string) (err error) {
119119
if !c.config.AutoRetry() {
120120
return call(ctx)
121121
}
122-
return retry.Retry(ctx, call, retry.WithStackTrace())
122+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
123123
}
124124

125125
func (c *Client) dropNode(ctx context.Context, path string) (err error) {
@@ -158,7 +158,7 @@ func (c *Client) DescribeNode(
158158
err = call(ctx)
159159
return
160160
}
161-
err = retry.Retry(ctx, call, retry.WithStackTrace())
161+
err = retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
162162
return
163163
}
164164

internal/ratelimiter/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (c *Client) CreateResource(
5858
if !c.config.AutoRetry() {
5959
return call(ctx)
6060
}
61-
return retry.Retry(ctx, call, retry.WithStackTrace())
61+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
6262
}
6363

6464
func (c *Client) createResource(
@@ -101,7 +101,7 @@ func (c *Client) AlterResource(
101101
if !c.config.AutoRetry() {
102102
return call(ctx)
103103
}
104-
return retry.Retry(ctx, call, retry.WithStackTrace())
104+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
105105
}
106106

107107
func (c *Client) alterResource(
@@ -144,7 +144,7 @@ func (c *Client) DropResource(
144144
if !c.config.AutoRetry() {
145145
return call(ctx)
146146
}
147-
return retry.Retry(ctx, call, retry.WithStackTrace())
147+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
148148
}
149149

150150
func (c *Client) dropResource(

internal/scheme/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (c *Client) MakeDirectory(ctx context.Context, path string) (err error) {
5151
if !c.config.AutoRetry() {
5252
return call(ctx)
5353
}
54-
return retry.Retry(ctx, call, retry.WithStackTrace())
54+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
5555
}
5656

5757
func (c *Client) makeDirectory(ctx context.Context, path string) (err error) {
@@ -80,7 +80,7 @@ func (c *Client) RemoveDirectory(ctx context.Context, path string) (err error) {
8080
if !c.config.AutoRetry() {
8181
return call(ctx)
8282
}
83-
return retry.Retry(ctx, call, retry.WithStackTrace())
83+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
8484
}
8585

8686
func (c *Client) removeDirectory(ctx context.Context, path string) (err error) {
@@ -207,7 +207,7 @@ func (c *Client) ModifyPermissions(ctx context.Context, path string, opts ...sch
207207
if !c.config.AutoRetry() {
208208
return call(ctx)
209209
}
210-
return retry.Retry(ctx, call, retry.WithStackTrace())
210+
return retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
211211
}
212212

213213
func (c *Client) modifyPermissions(ctx context.Context, path string, opts ...scheme.PermissionsOption) (err error) {

internal/scripting/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func (c *Client) Explain(
120120
err = call(ctx)
121121
return
122122
}
123-
err = retry.Retry(ctx, call, retry.WithStackTrace())
123+
err = retry.Retry(ctx, call, retry.WithStackTrace(), retry.WithIdempotent(true))
124124
return
125125
}
126126

internal/table/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,8 @@ func (c *Client) internalPoolGet(ctx context.Context, opts ...getOption) (s *ses
501501
})
502502
return s, xerrors.WithStackTrace(
503503
fmt.Errorf("failed to get session from pool ("+
504-
"attempts: %d, latency: %v, stats: {index: %d, idle: %d, create_in_progress: %d}"+
505-
"): %w", i, time.Since(start), index, idle, createInProgress, err,
504+
"attempts: %d, latency: %v, pool have %d sessions (%d busy, %d idle, %d create_in_progress): %w",
505+
i, time.Since(start), index, index-idle, idle, createInProgress, err,
506506
),
507507
)
508508
}

internal/table/scanner/result.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@ import (
99
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
1010
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb_TableStats"
1111

12-
"github.com/ydb-platform/ydb-go-sdk/v3/internal/value"
1312
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
1413
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xsync"
1514
"github.com/ydb-platform/ydb-go-sdk/v3/table/result"
1615
"github.com/ydb-platform/ydb-go-sdk/v3/table/stats"
1716
)
1817

19-
var (
20-
errAlreadyClosed = xerrors.Wrap(errors.New("result closed early"))
21-
errMissingCurrentRow = xerrors.Wrap(errors.New("missing current row"))
22-
)
18+
var errAlreadyClosed = xerrors.Wrap(errors.New("result closed early"))
2319

2420
type baseResult struct {
2521
scanner
@@ -60,17 +56,6 @@ func (r *baseResult) isClosed() bool {
6056
return atomic.LoadUint32(&r.closed) != 0
6157
}
6258

63-
func (r *baseResult) RowValues() (_ []value.Value, err error) {
64-
if r.row == nil {
65-
return nil, xerrors.WithStackTrace(errMissingCurrentRow)
66-
}
67-
values := make([]value.Value, len(r.row.GetItems()))
68-
for i, item := range r.row.GetItems() {
69-
values[i] = value.FromYDB(r.set.GetColumns()[i].GetType(), item)
70-
}
71-
return values, nil
72-
}
73-
7459
type resultWithError interface {
7560
SetErr(err error)
7661
}

0 commit comments

Comments
 (0)