-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for dml_rate_limit (#19679)
(cherry picked from commit f0a91df)
- Loading branch information
Showing
26 changed files
with
516 additions
and
27 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Due to the transaction semantic and MAX_CHUNK_FOR_ATOMICITY in DmlExecutor, | ||
# data chunks will be buffered for certain period before yielding. | ||
# To overcome this buffer, instead of inserting data in one transaction like insert into t SELECT generate_series, | ||
# this test inserts data via multiple inserts. | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & | ||
|
||
system ok | ||
nohup ./risedev psql -c 'insert into t values (1)' > /dev/null 2>&1 & |
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,17 @@ | ||
statement ok | ||
create table t(v1 int); | ||
|
||
statement ok | ||
alter table t set parallelism to 1; | ||
|
||
include ./inserts.slt.part | ||
|
||
sleep 3s | ||
|
||
query I | ||
select count(*) from t; | ||
---- | ||
30 | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
statement ok | ||
create table t(v1 int); | ||
|
||
statement ok | ||
alter table t set parallelism to 1; | ||
|
||
# Pause data stream. | ||
statement ok | ||
alter table t set dml_rate_limit to 0; | ||
|
||
include ./inserts.slt.part | ||
|
||
sleep 3s | ||
|
||
query I | ||
select count(*) from t; | ||
---- | ||
0 | ||
|
||
# Resume data stream. | ||
statement ok | ||
alter table t set dml_rate_limit to 1; | ||
|
||
sleep 3s | ||
|
||
query II | ||
select case when count(*) between 1 and 5 then 3 else 0 end from t; | ||
---- | ||
3 | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
statement ok | ||
set dml_rate_limit to 2; | ||
|
||
statement ok | ||
create table t(v1 int); | ||
|
||
statement ok | ||
alter table t set parallelism to 1; | ||
|
||
include ./inserts.slt.part | ||
|
||
sleep 3s | ||
|
||
query II | ||
select case when count(*) between 2 and 10 then 6 else 0 end from t; | ||
---- | ||
6 | ||
|
||
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
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.