File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -2181,7 +2181,9 @@ func (i *nsIndex) SetExtendedRetentionPeriod(period time.Duration) {
2181
2181
i .state .Lock ()
2182
2182
defer i .state .Unlock ()
2183
2183
2184
- i .extendedRetentionPeriod = period
2184
+ if period > i .extendedRetentionPeriod {
2185
+ i .extendedRetentionPeriod = period
2186
+ }
2185
2187
}
2186
2188
2187
2189
func (i * nsIndex ) effectiveRetentionPeriodWithLock () time.Duration {
Original file line number Diff line number Diff line change @@ -391,9 +391,9 @@ func TestNamespaceIndexSetExtendedRetentionPeriod(t *testing.T) {
391
391
idx .SetExtendedRetentionPeriod (longerRetention )
392
392
assert .Equal (t , longerRetention , idx .effectiveRetentionPeriodWithLock ())
393
393
394
- shorterRetention := originalRetention - time .Minute
394
+ shorterRetention := longerRetention - time .Second
395
395
idx .SetExtendedRetentionPeriod (shorterRetention )
396
- assert .Equal (t , originalRetention , idx .effectiveRetentionPeriodWithLock ())
396
+ assert .Equal (t , longerRetention , idx .effectiveRetentionPeriodWithLock ())
397
397
}
398
398
399
399
func verifyFlushForShards (
You can’t perform that action at this time.
0 commit comments