New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toggle event ordering for workspace/destination #4278
feat: toggle event ordering for workspace/destination #4278
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
20eb0fc
to
9988150
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4278 +/- ##
==========================================
+ Coverage 75.64% 75.69% +0.05%
==========================================
Files 381 381
Lines 46077 46120 +43
==========================================
+ Hits 34854 34912 +58
- Misses 8939 8942 +3
+ Partials 2284 2266 -18 ☔ View full report in Codecov by Sentry. |
db54ee0
to
d5fffa5
Compare
01a1935
to
11c37b2
Compare
This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR. |
11c37b2
to
9e0031c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
router/router_test.go
Outdated
require.ErrorIs(t, err, types.ErrJobOrderBlocked) | ||
}) | ||
|
||
t.Run("job not blocked after event ordering is disabled", func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a similar test for workspace ID as well?
router/worker.go
Outdated
@@ -871,7 +883,7 @@ func (w *worker) prepareResponsesForJobs(destinationJob *types.DestinationJobT, | |||
return respStatusCodes, respBodys | |||
} | |||
|
|||
func (w *worker) canSendJobToDestination(failedJobOrderKeys map[string]struct{}, destinationJob *types.DestinationJobT) bool { | |||
func (w *worker) canSendJobToDestination(failedJobOrderKeys map[eventorder.BarrierKey]struct{}, destinationJob *types.DestinationJobT) bool { | |||
if !w.rt.guaranteeUserEventOrder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add this check here as well?
(rt.guaranteeUserEventOrder && rt.barrier.Disabled(orderKey)) ||
(rt.eventOrderingDisabledForWorkspace(job.WorkspaceId) ||
rt.eventOrderingDisabledForDestination(parameters.DestinationID))
0f0abde
to
1170a58
Compare
1170a58
to
8baecb7
Compare
Description
Provides config to toggle event ordering at a workspace/destination level.(
"Router.orderingDisabledWorkspaceIDs"
,"Router.orderingDisabledDestinationIDs"
)On setting required workspace/destinationID, the barrier for that
BarrierKey
is disabled. Turns back to processing events in order once the config has been reset and after passing ofeventOrderDisabledStateDuration
andeventOrderHalfEnabledStateDuration
duration.Introduces
BarrierKey
which is just a composite:so the barrier methods now take this instead of the string(
<destID>:<userID>
) earlierLinear Ticket
linear
Security