Repository navigation
Can someone provide a concrete example of same-key reordering or non-contiguous gaps during changefeed replay? #174324
|
The docs state that for changefeeds:
And regarding ordering:
For my understanding this means reordered sequences like this are possible: I've been trying to understand the concrete mechanism that produces same-key reordering or non-contiguous gaps during replay, and after tracing through the code I can't find one. The two mechanisms I can find that create gaps are:
But both produce contiguous gaps (missing versions from the tail of GC or filtered versions), and neither produces reordering. My question: Can someone point to a concrete scenario or code path where a changefeed replay emits same-key events out of timestamp order, or produces a non-contiguous gap? |
Replies: 1 comment
|
You are right that CRDB will always attempt to publish events in order. The reason that you can see an ordering like 1,2,1,3 is that retries are not guaranteed to occur on the same TCP connection as the original request so the original request may be delayed somewhere between crdb and the receiver. Consider this ordering: request 1 - {version: 1} - stalls in the http load balancer |
You are right that CRDB will always attempt to publish events in order. The reason that you can see an ordering like 1,2,1,3 is that retries are not guaranteed to occur on the same TCP connection as the original request so the original request may be delayed somewhere between crdb and the receiver.
Consider this ordering:
request 1 - {version: 1} - stalls in the http load balancer
changefeed restarts for some reason (e.g. vm crashed, network partition, etc.)
request 2 - {version: 1} - delivered to destination
request 3 - {version: 2} - delivered to destination
request 4 - {version: 3} - delivered to destination
request 1 - {version: 1} - finally forwarded by http load balancer, observed o…