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

BigQuery template has dataset/table race condition #127

Closed
bohdanyurov-gl opened this issue Jun 18, 2019 · 2 comments
Closed

BigQuery template has dataset/table race condition #127

bohdanyurov-gl opened this issue Jun 18, 2019 · 2 comments

Comments

@bohdanyurov-gl
Copy link
Contributor

Creating dataset & tables in a single run has a high chance for "dataset not found error" to occur.

dependsOn does not help

@duizendstra
Copy link
Contributor

Based on the code and the test file I concluded that the dependsOn should be in the properties as:

    properties:
      name: test_bq_table
      dependsOn:
        - test-bq-dataset

The documentation mentions that dependsOn should be added as metadata.

Adding it to the properties as shown above does get rid of the race condition, however, it seems wrong to add it to the properties

@ocsig
Copy link
Member

ocsig commented Oct 28, 2019

Short answer

The BigQuery Table template is accepting a dependsOn value as a property and passes it to the resource metadata.

Other option is to reference the dataset as it is implemented in the example:
datasetId: $(ref.test-bq-dataset.datasetId)

This adds a direct dependency between the table and the dataset.

Long explanation

Unfortunately DM does not inherit the metadata value of a template to all the resoureces are created within the template and unfortunately the metadata is not accessible withing the template either, so it cannot do the inheritaion itself.

@ocsig ocsig closed this as completed Oct 28, 2019
Cloud Foundation Toolkit automation moved this from To do to Done Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants