-
Notifications
You must be signed in to change notification settings - Fork 609
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(stream): careful cache invadiation for TopN (#8659)
Co-authored-by: st1page <1245835950@qq.com>
- Loading branch information
Showing
11 changed files
with
245 additions
and
91 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# https://github.com/risingwavelabs/risingwave/issues/8570 | ||
# TopN cache invalidation issue | ||
|
||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table t(x int); | ||
|
||
statement ok | ||
create materialized view t_singleton as select * from t order by x limit 100; | ||
|
||
statement ok | ||
create materialized view mv as select * from t_singleton order by x limit 1; | ||
|
||
statement ok | ||
insert into t values (1), (2), (3), (4); | ||
|
||
statement ok | ||
delete from t where x = 2; | ||
|
||
statement ok | ||
insert into t values (5); | ||
|
||
statement ok | ||
delete from t where x = 1; | ||
|
||
statement ok | ||
insert into t values (6); | ||
|
||
statement ok | ||
delete from t where x = 3; | ||
|
||
# Shouldn't be 5 | ||
query I | ||
select * from mv; | ||
---- | ||
4 | ||
|
||
statement ok | ||
delete from t where x = 4; | ||
|
||
# Shouldn't panic | ||
statement ok | ||
insert into t values (1); | ||
|
||
statement ok | ||
drop materialized view mv; | ||
|
||
statement ok | ||
drop materialized view t_singleton; | ||
|
||
statement ok | ||
drop table t; |
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
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
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
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
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
Oops, something went wrong.