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

Error creating yandex_ydb_table with TTL in months #464

Open
baznikin opened this issue Aug 28, 2024 · 0 comments
Open

Error creating yandex_ydb_table with TTL in months #464

baznikin opened this issue Aug 28, 2024 · 0 comments
Labels
investigating ydb Yandex Database

Comments

@baznikin
Copy link

  1. I cant create yandex_ydb_table with TTL in months (P2M).
  2. However, if I change notation to days (P60D) table created.
  3. Subsequent runs of terraform apply tries to change P2M in cloud on P60D as written in manifest.
  4. If I change it to P2M there is no error (until I try to create new table with such manifest)

So, API accept only days notation, but store in internally in full ISO 8601 form.

resource "yandex_ydb_table" "outbound" {
  connection_string = yandex_ydb_database_serverless.this.ydb_full_endpoint
  path              = "${var.name}-table"
  primary_key       = ["event_id"]

  ttl {
    column_name     = "_timestamp"
    expire_interval = "P2M" # ISO 8601
  }

  column {
   # our columns here
  }
  column {
    name = "_timestamp"
    type = "Timestamp"
    not_null = false
  }
  column {
    name = "_partition"
    type = "String"
    not_null = false
  }
  column {
    name = "_offset"
    type = "Uint64"
    not_null = false
  }
  column {
    name = "_idx"
    type = "Uint32"
    not_null = false
  }
}

│ Error: failed to create table
│ 
│   with module.events.yandex_ydb_table.outbound,
│   on ../_modules/events-tracking/main.tf line 24, in resource "yandex_ydb_table" "outbound":
│   24: resource "yandex_ydb_table" "outbound" {
│ 
│ non-retryable error occurred on attempt No.1 (idempotent=false): connError{node_id:0,address:'ru-central1-a.ydb.serverless.yandexcloud.net:2135'}: operation/GENERIC_ERROR (code = 400080, address =
│ ru-central1-a.ydb.serverless.yandexcloud.net:2135, issues = [{16:8 => 'Invalid value "P2M" 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)`
  # module.events.yandex_ydb_table.outbound will be updated in-place
  ~ resource "yandex_ydb_table" "outbound" {
        id                     = "grpcs://ydb.serverless.yandexcloud.net:2135/?database=/ru-central1/xxxxxxxxxx"
        # (6 unchanged attributes hidden)

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

        # (12 unchanged blocks hidden)
    }
@opportunity356 opportunity356 added ydb Yandex Database investigating labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating ydb Yandex Database
Projects
None yet
Development

No branches or pull requests

2 participants