You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SelectWithStrategy maintains an internal state of termination for both sides. If one side is terminated, it'll never poll it in the future, for optimization.
match this.internal_state{InternalState::Start => {let next_side = (this.clos)(this.state);poll_inner(&mut this, next_side, cx)}InternalState::LeftFinished => match this.stream2.poll_next(cx){Poll::Ready(None) => {*this.internal_state = InternalState::BothFinished;Poll::Ready(None)}
a => a,},InternalState::RightFinished => match this.stream1.poll_next(cx){Poll::Ready(None) => {*this.internal_state = InternalState::BothFinished;Poll::Ready(None)}
a => a,},InternalState::BothFinished => Poll::Ready(None),}
If the source reader has finished before split changing (or scaling), even if we replace it with a new active reader, the SelectWithStrategy still won't poll it anymore. So we can never get the chunks from this source! Actually, the futures has warned us about this.
Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.
Since we set the event num for the Nexmark source in the deterministic scaling test, and it will finish after emitting all events, this is also why we get incorrect results if we allow scaling source in the chaos test.
BugenZhao
changed the title
scale: source reader will stall if previous reader has finished
source: source reader will stall after replacing if previous reader has finished
Nov 10, 2022
The
SelectWithStrategy
maintains an internal state of termination for both sides. If one side is terminated, it'll never poll it in the future, for optimization.If the source reader has finished before split changing (or scaling), even if we replace it with a new active reader, the
SelectWithStrategy
still won't poll it anymore. So we can never get the chunks from this source! Actually, thefutures
has warned us about this.risingwave/src/stream/src/executor/source/reader.rs
Lines 88 to 91 in 5d8465a
Since we set the event num for the Nexmark source in the deterministic scaling test, and it will finish after emitting all events, this is also why we get incorrect results if we allow scaling source in the chaos test.
risingwave/src/tests/simulation_scale/src/ctl_ext.rs
Lines 101 to 103 in 5d8465a
The text was updated successfully, but these errors were encountered: