Skip to content

feat: add WsAllowOutOfOrder config#68

Open
calvwang9 wants to merge 3 commits intov2-previewfrom
feat/ws-allow-out-of-order
Open

feat: add WsAllowOutOfOrder config#68
calvwang9 wants to merge 3 commits intov2-previewfrom
feat/ws-allow-out-of-order

Conversation

@calvwang9
Copy link
Copy Markdown

add new config WsAllowOutOfOrder to all SDKs, default false.

this allows the client exporter to filter out HF report gaps resulting from out-of-order reports

@calvwang9 calvwang9 requested a review from a team as a code owner April 9, 2026 05:10
@calvwang9 calvwang9 requested review from JoshC2k, akuzni2 and ro-tex April 9, 2026 05:10
type Stats struct {
Accepted uint64 // Total number of accepted reports
Deduplicated uint64 // Total number of deduplicated reports when in HA
OutOfOrder uint64 // Total number of out-of-order reports seen
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice touch!

go/stream.go Outdated
Comment on lines +371 to +375
if ts.Equal(wm) {
s.stats.skipped.Add(1)
s.waterMarkMu.Unlock()
return nil
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow. If we allow out of order, why are we skipping this one? Because it's a HA duplicate?
But if that's the intention, this will not work for out-of-order HA duplicates, causing uncertainty downstream.

If we want to catch those, we'd need a set of timestamps for which we have already received reports. We can have a background goroutine which trims the set by removing all entries older than, say, 5 seconds.

My advice here would be to either go with the set and have reliable filtering or remove the skip altogether when out-of-order reports are allowed. I'd prefer the former.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, i ended up rethinking the approach to handle these cases - extracted the dedup + watermark logic for clarity, which now maintains a fixed size buffer of 'seen' reports for dedup purposes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants