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

Correctly match RRs in the prefetch cache #84

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

DXTimer
Copy link
Contributor

@DXTimer DXTimer commented Mar 3, 2023

It was found that the prefetch feature. Which pulls the entire zone and creates a local cache for the provider to use and determine if a record already exists as a performance improvement and a way to reduce the number of API requests. The lookup algorithm did a naive lookup only based on the name of the Resource Record (RR), however, that can yield false positives and also result in incorrect records being created/updated.

Implementation notes

Unfortunately, the current version of the TF SDK does not support testing of for_each resources. The algorithm was updated to match all attributes that make a resource unique which are name, type, and content. There is also the potential of using the record ids to match existing records but the current implementation allows for some flexibility when using the provider especially since we do not support duplicate records.

Belongs to #80

@DXTimer DXTimer added the bug label Mar 3, 2023
@DXTimer DXTimer self-assigned this Mar 3, 2023
@DXTimer DXTimer requested a review from a user March 3, 2023 02:44
@DXTimer DXTimer requested review from a team and removed request for a team March 6, 2023 05:23
@DXTimer DXTimer merged commit b233c0c into master Mar 6, 2023
@DXTimer DXTimer deleted the fix/gh-80-prefetch-lookup branch March 6, 2023 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant