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

Changing source name silently fails #194

Closed
sthm opened this issue Jun 12, 2023 · 3 comments
Closed

Changing source name silently fails #194

sthm opened this issue Jun 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@sthm
Copy link

sthm commented Jun 12, 2023

When adapting the name of an existing source, the Terraform provider tries to update the name of the source in place. This fails silently and does not adapt the name of the source in Materialize.

  # materialize_source_kafka.kafka_text_source will be updated in-place
  ~ resource "materialize_source_kafka" "kafka_text_source" {
        id                 = "u61"
      ~ name               = "kafka_json_sorce" -> "kafka_json_source"
        # (9 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

I would have expected that the source is deleted and then recreated with the new name instead.

@sthm sthm changed the title Chaning source name silently fails Changing source name silently fails Jun 12, 2023
@sthm
Copy link
Author

sthm commented Jun 12, 2023

As per Marta's comment in Slack, the source should be indeed renamed in-place. Not sure why that is not carried out correctly.

$ terraform apply
materialize_secret.confluent_api_secret: Refreshing state... [id=u63]
materialize_secret.confluent_sr_secret: Refreshing state... [id=u62]
materialize_cluster.ingest_cluster: Refreshing state... [id=u23]
materialize_cluster.compute_cluster: Refreshing state... [id=u22]
materialize_cluster_replica.ingest_replica: Refreshing state... [id=u26]
materialize_connection_kafka.confluent_cloud: Refreshing state... [id=u64]
materialize_connection_confluent_schema_registry.confluent_schema_registry: Refreshing state... [id=u65]
materialize_source_kafka.kafka_text_source: Refreshing state... [id=u67]
materialize_cluster_replica.compute_replica: Refreshing state... [id=u25]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # materialize_source_kafka.kafka_text_source will be updated in-place
  ~ resource "materialize_source_kafka" "kafka_text_source" {
        id                 = "u67"
      ~ name               = "kafka_json_source" -> "kafka_json_source_altered"
        # (9 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

materialize_source_kafka.kafka_text_source: Modifying... [id=u67]
materialize_source_kafka.kafka_text_source: Modifications complete after 1s [id=u67]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

The name of the source should now be kafka_json_source_altered. But Materialize disagrees:

staging > show sources;
            name            |   type   | size
----------------------------+----------+------
 kafka_json_source          | kafka    | "\N"
 kafka_json_source_progress | progress | "\N"
(2 rows)

Steps to reproduce: create a source through Terraform and execute terraform apply. Change the name of the source in the template and execute terraform apply again.

@dehume dehume added the bug Something isn't working label Jun 12, 2023
benesch added a commit that referenced this issue Jun 13, 2023
The errors in update functions were previously ignored. This is
obscuring whatever error is occuring in #194.
dehume pushed a commit that referenced this issue Jun 13, 2023
The errors in update functions were previously ignored. This is
obscuring whatever error is occuring in #194.
@dehume
Copy link
Contributor

dehume commented Jun 13, 2023

Will be fixed in #200

@dehume
Copy link
Contributor

dehume commented Jun 14, 2023

Will be part of 0.0.8

@dehume dehume closed this as completed Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants