Skip to content

Commit

Permalink
Merge pull request #1423 from ydb-platform/pool-from-table
Browse files Browse the repository at this point in the history
internal pool implementation from table pool
  • Loading branch information
asmyasnikov authored Sep 6, 2024
2 parents 1d8bf01 + b973c9c commit 082b514
Show file tree
Hide file tree
Showing 26 changed files with 1,460 additions and 755 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ jobs:
workload_build_context4: ../..
workload_build_options4: -f Dockerfile --build-arg SRC_PATH=native/query --build-arg JOB_NAME=workload-native-query

language_id5: 'native-query-with-pool'
workload_path5: 'tests/slo'
language5: 'Native ydb-go-sdk/v3 over query-service with session pool'
workload_build_context5: ../..
workload_build_options5: -f Dockerfile --build-arg SRC_PATH=native/query/with/pool --build-arg JOB_NAME=workload-native-query-with-pool

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
YDB_LOCAL_SURVIVE_RESTART: true
YDB_USE_IN_MEMORY_PDISKS: true
YDB_TABLE_ENABLE_PREPARED_DDL: true
YDB_ENABLE_COLUMN_TABLES: true
options: '-h localhost'
env:
OS: ubuntu-latest
Expand Down Expand Up @@ -119,6 +120,7 @@ jobs:
YDB_USE_IN_MEMORY_PDISKS: true
YDB_TABLE_ENABLE_PREPARED_DDL: true
YDB_FEATURE_FLAGS: enable_topic_service_tx
YDB_ENABLE_COLUMN_TABLES: true
options: '-h localhost'
env:
OS: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Changed `trace.Table` and `trace.Query` traces
* Changed `trace.Table` and `trace.Query` traces
* Implemented `internal/pool` the same as table client pool from `internal/table.Client`

## v3.79.0
* Added commit messages for topic listener
Expand Down
10 changes: 9 additions & 1 deletion internal/pool/defaults.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
package pool

const DefaultLimit = 50
import (
"time"
)

const (
DefaultLimit = 50
defaultCreateTimeout = 5 * time.Second
defaultCloseTimeout = time.Second
)
27 changes: 27 additions & 0 deletions internal/pool/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package pool

import (
"errors"

"github.com/ydb-platform/ydb-go-genproto/protos/Ydb"
grpcCodes "google.golang.org/grpc/codes"

"github.com/ydb-platform/ydb-go-sdk/v3/internal/xerrors"
)

var (
Expand All @@ -10,3 +15,25 @@ var (
errPoolIsOverflow = errors.New("pool is overflow")
errNoProgress = errors.New("no progress")
)

func isRetriable(err error) bool {
if err == nil {
panic(err)
}

switch {
case
xerrors.Is(err, errPoolIsOverflow),
xerrors.IsRetryableError(err),
xerrors.IsOperationError(err, Ydb.StatusIds_OVERLOADED),
xerrors.IsTransportError(
err,
grpcCodes.ResourceExhausted,
grpcCodes.DeadlineExceeded,
grpcCodes.Unavailable,
):
return true
default:
return false
}
}
Loading

0 comments on commit 082b514

Please sign in to comment.