-
Notifications
You must be signed in to change notification settings - Fork 646
Stream TopN panics #8570
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
Comments
The only suspecious place I could find now is: risingwave/src/stream/src/executor/top_n/top_n_cache.rs Lines 258 to 267 in 81b4d59
where L258 didn't remove a row in middle when it's full, and L267 inserts a row. (Is this possible?) |
The root cause is:
We should either refill high cache after 1 or before 2 |
Here's a reproduce: create table t(x int);
create materialized view mv as select * from t order by x limit 1;
insert into t values (1), (2), (3), (4);
delete from t where x = 2;
insert into t values (5);
delete from t where x = 1;
insert into t values (6);
delete from t where x = 3;
delete from t where x = 4;
insert into t values (1); -- panics! illustration:
|
I guess this could happen in higher possibility when the TopN's input has frequent deletes. In the given example, it's a GroupTopN, which has many deletes. 🥲 |
This reminds me of the |
We need to make sure that every cache should be "full" forever which means there is only three kinds of states:
To maintain it, we need to do the delete operation in the cache cascade. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
To Reproduce
Then wait a while. easily reproduable.
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: