roachprod: avoid syncing all the time #137956
Draft
765
−292
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A few commands that alter a single cluster were forcing a sync of all clusters across all Cloud providers after execution in order to refresh
roachprod
's local cache. While this behavior limits the possibility of a cache drift, it can lead to many issues (as describe in #130082).By updating the
Provider{}
interface, this patch forces its implementations to return an updatedvm.List
argument when creating or modifying a cluster. This allows to directly update the local cache without having to sync from the Cloud providers again. As most of the commands executed to alter a cluster already return the information required to update the cache, this also reduces the number of API calls to the Cloud providers.The following commands have been updated:
Epic: none
Release note: None