You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref(crons): Guard clock ticks against desynced-partitions
This fixes an issue with the original implementation of GH-54204 when
processing messages in a non-monotonic order.
Typically kafka messages will be in order like such
12:59:58
12:59:59
01:00:00
01:00:01
01:00:01
01:00:02
However, because of how messages are shared into the kafka partitions we
may end up with a secnario that looks like this
partitions
#1#2#3
12:59:58 01:00:00 01:00:01
12:59:59 01:00:01 01:00:02
With one consumer reading from each partition sequentially we would read
these out as
12:59:58
01:00:00
01:00:01
12:59:59 <-- problematic skip backwards in time
01:00:01
01:00:02
Prior to this change, when we would process the task_trigger clock tick
for the timestamp `12:59:59` after `01:00:01` our `GETSET` would update
the key with an OLDER timestamps.
When the next tick happens at `01:00:01` we would now tick for the
`01:00:00` minute boundary again incorrectly.
This change corrects this by first looking at the existing last
timestamp value stored in redis, if that value is smaller than the
reference timestamp we're about to tick for, do nothing, do not store
the older reference timestamp.
0 commit comments