Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dataflow: Track BackUnionState as part of FullWait
To implement the bag-union semantics of an OR between filters, unions internally track some state via a field on the union itself, and use that state when processing records to optionally omit some extra rows. However, when buffering full replays, we might receive different chunks of state as part of entirely separate replays in different orders from our parents - for example, we might receive a replay with tag 1 from our left parent, then a replay with tag 2 from our right parent, then the other half of the replay with tag 1 from our right parent. Previously, since we were always using the BagUnionState on the Union itself, this could cause us to emit the wrong results due to that BagUnionState mistakenly thinking the first two chunks of state were part of the same replay. To fix that, this commit adds an `Option<BagUnionState>` field to FulWait, and uses that when processing records (which is now broken out from `on_input` into its own function) during buffering of full replays *by tag*, to avoid getting BagUnionState mixed up between replays of different tags (see 60f8a85c7 (dataflow: Buffer full replays in unions by tag, 2023-07-14) for more info here). When we then eventually release the full replay, the buffered records have become "canonical" - so we also make the BagUnionState itself canonical, by setting it as `self.bag_union_state` on the Union. This fixes 10 previously-failing generated logictests Change-Id: I0c8429eb991f56016d851f052f54cee5dc68b914 Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5471 Tested-by: Buildkite CI Reviewed-by: Dan Wilbanks <dan@readyset.io>
- Loading branch information
1 parent
ed2b33a
commit f7ffbe6
Showing
11 changed files
with
137 additions
and
47 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters