Skip to content

Commit 082b514

Browse files
authored
Merge pull request #1423 from ydb-platform/pool-from-table
internal pool implementation from table pool
2 parents 1d8bf01 + b973c9c commit 082b514

File tree

26 files changed

+1460
-755
lines changed

26 files changed

+1460
-755
lines changed

.github/workflows/slo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ jobs:
7373
workload_build_context4: ../..
7474
workload_build_options4: -f Dockerfile --build-arg SRC_PATH=native/query --build-arg JOB_NAME=workload-native-query
7575

76-
language_id5: 'native-query-with-pool'
77-
workload_path5: 'tests/slo'
78-
language5: 'Native ydb-go-sdk/v3 over query-service with session pool'
79-
workload_build_context5: ../..
80-
workload_build_options5: -f Dockerfile --build-arg SRC_PATH=native/query/with/pool --build-arg JOB_NAME=workload-native-query-with-pool
81-
8276
- uses: actions/upload-artifact@v4
8377
if: always()
8478
with:

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
YDB_LOCAL_SURVIVE_RESTART: true
6767
YDB_USE_IN_MEMORY_PDISKS: true
6868
YDB_TABLE_ENABLE_PREPARED_DDL: true
69+
YDB_ENABLE_COLUMN_TABLES: true
6970
options: '-h localhost'
7071
env:
7172
OS: ubuntu-latest
@@ -119,6 +120,7 @@ jobs:
119120
YDB_USE_IN_MEMORY_PDISKS: true
120121
YDB_TABLE_ENABLE_PREPARED_DDL: true
121122
YDB_FEATURE_FLAGS: enable_topic_service_tx
123+
YDB_ENABLE_COLUMN_TABLES: true
122124
options: '-h localhost'
123125
env:
124126
OS: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
* Changed `trace.Table` and `trace.Query` traces
1+
* Changed `trace.Table` and `trace.Query` traces
2+
* Implemented `internal/pool` the same as table client pool from `internal/table.Client`
23

34
## v3.79.0
45
* Added commit messages for topic listener

internal/pool/defaults.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
package pool
22

3-
const DefaultLimit = 50
3+
import (
4+
"time"
5+
)
6+
7+
const (
8+
DefaultLimit = 50
9+
defaultCreateTimeout = 5 * time.Second
10+
defaultCloseTimeout = time.Second
11+
)

internal/pool/errors.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ package pool
22

33
import (
44
"errors"
5+
6+
"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
7+
grpcCodes "google.golang.org/grpc/codes"
8+
9+
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
510
)
611

712
var (
@@ -10,3 +15,25 @@ var (
1015
errPoolIsOverflow = errors.New("pool is overflow")
1116
errNoProgress = errors.New("no progress")
1217
)
18+
19+
func isRetriable(err error) bool {
20+
if err == nil {
21+
panic(err)
22+
}
23+
24+
switch {
25+
case
26+
xerrors.Is(err, errPoolIsOverflow),
27+
xerrors.IsRetryableError(err),
28+
xerrors.IsOperationError(err, Ydb.StatusIds_OVERLOADED),
29+
xerrors.IsTransportError(
30+
err,
31+
grpcCodes.ResourceExhausted,
32+
grpcCodes.DeadlineExceeded,
33+
grpcCodes.Unavailable,
34+
):
35+
return true
36+
default:
37+
return false
38+
}
39+
}

0 commit comments

Comments
 (0)