fix: configure discard policy for WorkQueue/Interest #1884
fix: configure discard policy for WorkQueue/Interest #1884vigith merged 2 commits intonumaproj:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1884 +/- ##
==========================================
+ Coverage 54.31% 54.48% +0.17%
==========================================
Files 288 288
Lines 28301 28306 +5
==========================================
+ Hits 15371 15422 +51
+ Misses 11994 11953 -41
+ Partials 936 931 -5 ☔ View full report in Codecov by Sentry. |
|
should we add a check so that nobody will turn on |
|
In that case do you want to tie both the properties together instead of configurable?
|
| retention := nats.RetentionPolicy(v.GetInt("stream.retention")) | ||
| discard := nats.DiscardPolicy(v.GetInt("stream.discardPolicy")) | ||
| // we cannot use DiscardNew with Limits policy. | ||
| if retention == nats.LimitsPolicy && discard == nats.DiscardNew { |
There was a problem hiding this comment.
Should we also check if it is not the other? WorkQueue with DiscardOld?
There was a problem hiding this comment.
nevermind, just saw that @vigith has already made that comment.
I would think so, @whynowy ? |
| replicas: 3 | ||
| duplicates: 60s | ||
| # 0: DiscardOld, 1: DiscardNew | ||
| discardPolicy: 0 |
There was a problem hiding this comment.
just curious, why do we have multiple configs where we have this field set?
There was a problem hiding this comment.
We use the different installation strategies for the numaflow controller, so replicating it for all.
Signed-off-by: Sidhant Kohli <sidhant.kohli@gmail.com>
| if retention == nats.WorkQueuePolicy { | ||
| discard = nats.DiscardNew | ||
| } |
There was a problem hiding this comment.
what about Interest? Why should it be DiscardOld? please document
There was a problem hiding this comment.
I went ahead as it was default, but I realised it didn't seem to be correct.
We should use it with DiscardNew instead
I have added few lines to document, please take a look @vigith
Signed-off-by: Sidhant Kohli <sidhant.kohli@gmail.com>
No description provided.