Adjust TS and cycles when adjusting start. (#1971)
* Adjust TS and cycles when adjusting start. Chasing some AddPacket errors across relay. Noticed that in one case the start/end sequence was flipped. There is a known issue of it happening with resync. Unclear if this instance was due to resync or not. The start was close to the edge (64513). So, thought maybe adjust at start and noticed that it needs to maybe increase cycle count if start is wrapping back. In this case, the start is 1000 before wrap point. So, may not be a wrap back issue, but addressing what I found anyway. * fix test
This commit is contained in:
@@ -113,7 +113,7 @@ func (w *WrapAround[T, ET]) maybeAdjustStart(val T) (isRestart bool, preExtended
|
||||
|
||||
// re-adjust start if necessary. The conditions are
|
||||
// 1. Not seen more than half the range yet
|
||||
// 1. wrap around compared to start and not completed a half cycle, sequences like (10, 65530) in uint16 space
|
||||
// 1. wrap back compared to start and not completed a half cycle, sequences like (10, 65530) in uint16 space
|
||||
// 2. no wrap around, but out-of-order compared to start and not completed a half cycle , sequences like (10, 9), (65530, 65528) in uint16 space
|
||||
cycles := w.cycles
|
||||
totalNum := w.GetExtendedHighest() - w.GetExtendedStart() + 1
|
||||
|
||||
Reference in New Issue
Block a user