Skip to content
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

risingwave_stream::executor::aggregation::agg_group: bad row count group=OwnedRow(...) #14095

Closed
kwannoel opened this issue Dec 20, 2023 · 6 comments
Labels
type/bug Something isn't working
Milestone

Comments

@kwannoel
Copy link
Contributor

kwannoel commented Dec 20, 2023

Some users recently encounter this, after cluster recovery.

thread 'risingwave-streaming-actor' panicked at /risingwave/src/stream/src/executor/aggregation/agg_group.rs:320:13: row count should be non-negative
@github-actions github-actions bot added this to the release-1.6 milestone Dec 20, 2023
@kwannoel kwannoel changed the title risingwave_stream::executor::aggregation::agg_group: bad row count group=OwnedRow(...) thread 'risingwave-streaming-actor' panicked at /risingwave/src/stream/src/executor/aggregation/agg_group.rs:320:13: row count should be non-negative risingwave_stream::executor::aggregation::agg_group: bad row count group=OwnedRow(...) Dec 20, 2023
@kwannoel
Copy link
Contributor Author

Related #14031

@lmatz lmatz added type/bug Something isn't working and removed type/feature labels Dec 21, 2023
@kwannoel
Copy link
Contributor Author

kwannoel commented Dec 23, 2023

CR: @hzxa21 who initially found that it could potentially lead to backwards compat issues.

I can confirm this should probably be due to case backwards compatibility.

On v1.4-rc:

drop table t cascade;
create table t(x boolean, a int, y boolean, b int);
insert into t values (true, 1, true, 2);
create materialized view m1 as select 'abc' as v1, case when x then a when y then b end as case_col from t group by case_col;
select * from m1;

On v1.5.0-rc:

delete from t;
flush;

Agg panics with:

thread 'risingwave-streaming-actor' panicked at /Users/noelkwan/projects/risingwave/src/stream/src/executor/aggregation/agg_group.rs:320:13:
row count should be non-negative
stack backtrace:
   0: rust_begin_unwind
             at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/library/core/src/panicking.rs:72:14
   2: risingwave_stream::executor::aggregation::agg_group::AggGroup<S,Strtg>::curr_row_count
             at ./src/stream/src/executor/aggregation/agg_group.rs:320:13
   3: risingwave_stream::executor::aggregation::agg_group::AggGroup<S,Strtg>::apply_chunk::{{closure}}
             at ./src/stream/src/executor/aggregation/agg_group.rs:351:12
   4: risingwave_stream::executor::hash_agg::HashAggExecutor<K,S>::apply_chunk::{{closure}}
             at ./src/stream/src/executor/hash_agg.rs:419:18
   5: risingwave_stream::executor::hash_agg::HashAggExecutor<K,S>::execute_inner::{{closure}}
             at ./src/stream/src/executor/hash_agg.rs:650:68
   6: <futures_async_stream::try_stream::GenTryStream<G> as futures_core::stream::Stream>::poll_next
             at /Users/noelkwan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-async-stream-0.2.9/src/lib.rs:506:33
   7: <core::pin::Pin<P> as futures_core::stream::Stream>::poll_next
             at /Users/noelkwan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-core-0.3.28/src/stream.rs:120:9
   8: <core::pin::Pin<P> as futures_core::stream::Stream>::poll_next
             at /Users/noelkwan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-core-0.3.28/src/stream.rs:120:9
   9: futures_util::stream::stream::StreamExt::poll_next_unpin
             at /Users/noelkwan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.28/src/stream/stream/mod.rs:1632:9
Sat Dec 23 03:00:56 UTC 2023 [risedev]: Program exited with 139

@stdrc
Copy link
Member

stdrc commented Dec 25, 2023

Is this possibly caused by #13890? Cc @wangrunji0408

@kwannoel
Copy link
Contributor Author

Is this possibly caused by #13890? Cc @wangrunji0408

Yeah, may look at bugens comment in that PR

@MrCroxx
Copy link
Contributor

MrCroxx commented Dec 26, 2023

Is this possibly caused by #13890? Cc @wangrunji0408

Yeah, may look at bugens comment in that PR

FYI: #13890 (comment)

@kwannoel
Copy link
Contributor Author

kwannoel commented Jan 9, 2024

One of the root cause is case expression. For the other root cause it is unclear.

For case expression, we can't really avoid the breaking change in expr framework.

We have to inform users of the breaking change via the release notes, and get them to recreate any MVs with case expressions. The v1.5 release notes have been updated for CASE expression.
Screenshot 2024-01-09 at 12 17 56 PM

https://docs.risingwave.com/release-notes/

@kwannoel kwannoel closed this as completed Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants