yandex-cloud / terraform-provider-yandex

Terraform Yandex provider
https://www.terraform.io/docs/providers/yandex/
Mozilla Public License 2.0
211 stars 116 forks source link

Clickhouse: no changed detected #468

Open sharovmerk opened 2 months ago

sharovmerk commented 2 months ago

Reproduce:

  1. create clickhouse cluster with 3 zk host and 1 master host
  2. rename master host
  3. Retrieve an error:
    │ Error: error while requesting API to update ClickHouse Cluster "XXX": server-request-id = 43f393b6-4038-4bf6-ac49-640aeb475f67 server-trace-id = b49d062b90ce29e4:251236e788fe3884:b49d062b90ce29e4:1 client-request-id = c72f668a-d180-4e46-acf6-bcfa123f9a43 client-trace-id = 006fd876-b724-42aa-a852-f3d3bee04b91 rpc error: code = FailedPrecondition desc = no changes detected
    │ 

    provider version 1.129.0

sharovmerk commented 2 months ago

output from plan:

  # module.seed.module.clickhouse["c01"].yandex_mdb_clickhouse_cluster.this will be updated in-place
  ~ resource "yandex_mdb_clickhouse_cluster" "this" {
        id                       = "XXX"
        name                     = "XXX"
        # (16 unchanged attributes hidden)

      - shard {
          - name   = "shard1" -> null
          - weight = 100 -> null

          - resources {
              - disk_size          = 90 -> null
              - disk_type_id       = "network-ssd" -> null
              - resource_preset_id = "s2.small" -> null
            }
        }
      + shard {
          + name   = "master01"
          + weight = 100

          + resources {
              + disk_size          = 90
              + disk_type_id       = "network-ssd"
              + resource_preset_id = "s2.small"
            }
        }

      ~ zookeeper {
          ~ resources {
              ~ disk_size          = 10 -> 0
                # (2 unchanged attributes hidden)
            }
        }

        # (9 unchanged blocks hidden)
    }
sharovmerk commented 2 months ago

Воспроизводится даже без переименования шардов:

  ~ resource "yandex_mdb_clickhouse_cluster" "this" {
        id                       = "XXX"
        name                     = "XXX"
        # (16 unchanged attributes hidden)

      ~ zookeeper {
          ~ resources {
              ~ disk_size          = 10 -> 0
                # (2 unchanged attributes hidden)
            }
        }

        # (10 unchanged blocks hidden)
    }