feat: support stream buffer policies - #4133
Conversation
…tage Signed-off-by: pulkitvats2007-crypto <pulkitvats2007@gmail.com>
Signed-off-by: Jiayin Ng <ngjaying@gmail.com>
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4133 +/- ##
==========================================
+ Coverage 71.03% 71.10% +0.07%
==========================================
Files 473 473
Lines 55882 56006 +124
==========================================
+ Hits 39693 39819 +126
+ Misses 13127 13125 -2
Partials 3062 3062 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
|
Simplified the backpressure implementation in c3abb6f:
This matches the invariant that one rule has one buffer-full policy and avoids pretending mixed policies can be isolated on a sequential broadcast path. |
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
|
Updated in cfaaa3d to make the new stream policy fully opt-in and backward compatible:
The PR description and documentation now reflect these semantics. |
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
|
Added coverage in e10de5a for the new buffer-policy paths:
Targeted package tests and race repetitions pass locally. Remote CI/Codecov is now recalculating the patch. |
|
Clarification: the rule-level |
Signed-off-by: Jiyong Huang <huangjy@emqx.io>
3d3b898 to
496cd04
Compare
Summary
BUFFER_FULL_POLICY="block|dropOldest"to stream definitionsdisableBufferFullDiscardrule option only as a compatibility fallbackDeprecation
The rule option
disableBufferFullDiscardis deprecated. It remains supported so existing rules keep their previous behavior, but it is not recommended for new or updated rules. ConfigureBUFFER_FULL_POLICYon stream definitions instead. The stream-level option is the source of truth and takes precedence over the deprecated rule option.Compatibility
Existing rules keep their previous buffer behavior. When
BUFFER_FULL_POLICYis omitted, non-shared streams fall back to the deprecateddisableBufferFullDiscardrule option, whose default remainsfalse. QoS 1/2 does not implicitly change the buffer policy.A shared stream without
BUFFER_FULL_POLICYkeeps the legacydropOldestbehavior. As before,disableBufferFullDiscard=trueis invalid for such a shared stream. ConfigureBUFFER_FULL_POLICY="block"on the shared stream to opt into lossless in-memory channel delivery and backpressure.For rules with multiple streams, every stream must resolve to the same policy. A conflict is reported during planning with the stream names and resolved policies.
This prevents channel-full data loss but does not add checkpoint or source-offset recovery to the shared source component.
Tests
TZ=UTC go test ./internal/xsqlgo test ./internal/processorgo test ./internal/topo/planner ./internal/topo ./internal/topo/nodego test -race ./internal/topo/node ./internal/topo ./internal/topo/planner-count=20Supersedes #4024.