Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yandex_ydb_table inconsistent ttl behaviour #466

Open
baznikin opened this issue Sep 2, 2024 · 1 comment
Open

yandex_ydb_table inconsistent ttl behaviour #466

baznikin opened this issue Sep 2, 2024 · 1 comment
Labels
enhancement ydb Yandex Database

Comments

@baznikin
Copy link

baznikin commented Sep 2, 2024

ttl { expire_interval } stored internaly in the cloud in ISO 8601 with full range of its possibilities (i.e. with M, Y fields) and provider every time try to replace notion in days with it internal stored value:

      - ttl {
          - column_name     = "_timestamp" -> null
          - expire_interval = "P1Y" -> null
            # (1 unchanged attribute hidden)
        }
      + ttl {
          + column_name     = "_timestamp"
          + expire_interval = "P365D"
          + unit            = (known after apply)
        }

However, API accept only notion in days; if you try to create new resource with value P1Y (i.e. as it is stored in the cloud), API error occurs:

│ non-retryable error occurred on attempt No.1 (idempotent=false): connError{node_id:0,address:'ru-central1-b.ydb.serverless.yandexcloud.net:2135'}: operation/GENERIC_ERROR (code = 400080, address =
│ ru-central1-b.ydb.serverless.yandexcloud.net:2135, issues = [{16:8 => 'Invalid value "P1Y" for type Interval'}]) at `github.com/ydb-platform/ydb-go-sdk/v3/internal/conn.(*conn).Invoke(conn.go:373)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).wrapCall(balancer.go:358)` at `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.(*session).ExecuteSchemeQuery(session.go:841)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.do.func1(retry.go:54)` at `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.retryBackoff.func1(retry.go:85)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/retry.Retry(retry.go:314)` at `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.(*Client).Do(client.go:658)`
@nikolaymatrosov
Copy link
Contributor

Actually, it is stored as seconds and is converted just in the provider.
https://github.com/ydb-platform/terraform-provider-ydb/blob/main/internal/resources/table/table.go#L369

@PeppaTheC PeppaTheC added ydb Yandex Database enhancement labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ydb Yandex Database
Projects
None yet
Development

No branches or pull requests

3 participants