Skip to content

Commit

Permalink
ydb support: single-statement atomic transfer, custom tls certificate…
Browse files Browse the repository at this point in the history
…s and more
  • Loading branch information
Maksim Zinal authored and DmitryTravyan committed Dec 22, 2022
1 parent 4172da9 commit f01fa99
Show file tree
Hide file tree
Showing 10 changed files with 328 additions and 332 deletions.
20 changes: 20 additions & 0 deletions README_ydb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# YDB-specific configuration for stroppy tests

To support the authentication methods specific to YDB Managed Service, stroppy uses the additional environment variables when running in *client* mode only:
* `YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS` - the path to the service account key file. When configured, the key file is used to authenticate the connection.
* `YDB_METADATA_CREDENTIALS` - when set to `1`, the service account key associated with the Cloud compute instance is used to authenticate the connection.
* `YDB_ACCESS_TOKEN_CREDENTIALS` - YDB access token. When configured, the access token is passed as is to authenticate the connection.
* `YDB_TLS_CERTIFICATES_FILE` - PEM-encoded file with custom TLS certificate(s) to be used for GRPCS connections.

In addition, there are the following YDB-specific environment variables:
* `YDB_STROPPY_PARTITIONS_COUNT` - [`AUTO_PARTITIONING_MIN_PARTITIONS_COUNT`](https://ydb.tech/en/docs/concepts/datamodel/table#auto_partitioning_partition_size_mb) setting value for `account` and `transfer` tables. This setting only affects the `pop` operation mode.
* `YDB_STROPPY_PARTITIONS_SIZE` - [`AUTO_PARTITIONING_PARTITION_SIZE_MB`](https://ydb.tech/en/docs/concepts/datamodel/table#auto_partitioning_min_partitions_count) setting value for `account` and `transfer` tables. This setting only affects the `pop` operation mode.
* `YDB_STROPPY_HASH_TRANSFER_ID` - when set to `1`, the actual value of `transfer_id` field in the `transfer` table is replaced with its SHA-1 hash code (Base-64 encoded). This setting only affects the `pay` operation mode.

Typical "client" operation modes command examples:

```bash
export YDB_DB='grpc://stroppy:passw0rd@ycydb-d1:2136?database=/Root/testdb'
./stroppy pop --dbtype ydb --url "$YDB_DB" -n 1000000 -w 8000 --run-type client
./stroppy pay --dbtype ydb --url "$YDB_DB" -n 10000000 -w 8000 --run-type client
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/tidwall/gjson v1.8.1
github.com/ydb-platform/ydb-go-genproto v0.0.0-20220922065549-66df47a830ba
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2
github.com/ydb-platform/ydb-go-sdk/v3 v3.38.2
github.com/ydb-platform/ydb-go-sdk/v3 v3.40.1
github.com/ydb-platform/ydb-kubernetes-operator v0.0.0-20220913070254-59c84ccfc365
github.com/zalando/postgres-operator v1.6.3
github.com/zclconf/go-cty v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1039,8 +1039,8 @@ github.com/ydb-platform/ydb-go-genproto v0.0.0-20220922065549-66df47a830ba/go.mo
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2 h1:EYSI1kulnHb0H0zt3yOw4cRj4ABMSMGwNe43D+fX7e4=
github.com/ydb-platform/ydb-go-sdk-auth-environ v0.1.2/go.mod h1:Xfjce+VMU9yJVr1lj60yK2fFPWjB4jr/4cp3K7cjzi4=
github.com/ydb-platform/ydb-go-sdk/v3 v3.25.3/go.mod h1:PFizF/vJsdAgEwjK3DVSBD52kdmRkWfSIS2q2pA+e88=
github.com/ydb-platform/ydb-go-sdk/v3 v3.38.2 h1:SbrZWu21pteBjZBLDQwJz1LgcJCC6D3kcQurAmpFTF8=
github.com/ydb-platform/ydb-go-sdk/v3 v3.38.2/go.mod h1:SOpOg3nIQ7kT337LvWGNjfdpTQmFEeHXDqY/huSu+Xc=
github.com/ydb-platform/ydb-go-sdk/v3 v3.40.1 h1:6a/yMcXT+ZpybYsGvEpFSsOdQlbqtArycUqY7U1Yd1w=
github.com/ydb-platform/ydb-go-sdk/v3 v3.40.1/go.mod h1:hJqWSE2NZ2o2c9geHtRJee+xwiHgEfQX9koBZPLTfHY=
github.com/ydb-platform/ydb-go-yc v0.8.3 h1:92UUUMsfvtMl6mho8eQ9lbkiPrF3a9CT+RrVRAKNRwo=
github.com/ydb-platform/ydb-go-yc v0.8.3/go.mod h1:zUolAFGzJ5XG8uwiseTLr9Lapm7L7hdVdZgLSuv9FXE=
github.com/ydb-platform/ydb-go-yc-metadata v0.5.2 h1:nMtixUijP0Z7iHJNT9fOL+dbmEzZxqU6Xk87ll7hqXg=
Expand Down
82 changes: 0 additions & 82 deletions pkg/database/cluster/yandex_constans.go

This file was deleted.

Loading

0 comments on commit f01fa99

Please sign in to comment.