databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
456 stars 393 forks source link

[Fix] Set ID for online table resource if creation succeeds but it isn't available yet #4072

Closed tanmay-db closed 1 month ago

tanmay-db commented 1 month ago

Changes

We should set the id right after creation and before waiting for online table to be available. This is because in case when online table isn't available, we still should have that resource in the state.

Also the timeout has been increased to 2x (I am going to following up with online tables team for suitable timeout but since we have to do a release, going ahead with small time increase should be good)

Note: We should add setting id right after creation for similar resources to CONTRIBUTING guide (which I will do in a separate PR)

Tests

Added unit test to check that pathway, id is set (which wasn't the case before)

alexott commented 1 month ago

if it will fail to initialize online table during waiting, it will be in the broken state. We really need to get the definitive answer from the dev team about condition when table is considered successfully created and initialized.

tanmay-db commented 1 month ago

@alexott that is true but the resource would still be there in the failed state and we should put this in the state even if the resources is not available (but creation succeeds).

tanmay-db commented 1 month ago

Hi @mgyucht, yes regarding contributing guide, I will be doing that in a separate PR so we isolate the changes.