Commit 57b5f1b
committed
Force DuplicatePolicy for Redis TS created programmatically by Cosmotech API.
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/upgraded1 parent 1ebc66d commit 57b5f1b
File tree
1 file changed
+17
-3
lines changed- metrics/src/main/kotlin/com/cosmotech/metrics
1 file changed
+17
-3
lines changedLines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
72 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
| |||
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
92 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
93 | 107 | | |
94 | 108 | | |
95 | 109 | | |
| |||
0 commit comments