Force DuplicatePolicy for Redis TS created programmatically by Cosmotech #852
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.
Depending on target deployment environment, Redis TS can have DUPLICATE_POLICY set to BLOCK. Until now, Redis TS created by Cosmotech API relied on target environment (without override the default value) As we log every API calls, when API is flooded, it can lead to HTTP errors 500 when Redis is deployed with DUPLICATE_POLICY set to BLOCK (https://redis.io/docs/latest/develop/data-types/timeseries/configuration/#duplicate_policy).
To prevent that, every Redis TS will be created now with DUPLICATE_POLICY set to MAX. Doing that, will not lead to HTTP 500 error and if X Redis TS will be created with the same timestamp, only the TS with the maximum value will be kept.
Note: You should delete all previously created one. A Redis TS cannot be changed/upgraded