forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request duckdb#10897 from Mytherin/checkpointfatal
Storage: Fix an internal exception that could be triggered when deleting many rows and checkpointing repeatedly
- Loading branch information
Showing
4 changed files
with
123 additions
and
54 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
53 changes: 53 additions & 0 deletions
53
test/sql/storage/buffer_manager/appending_table_exceeding_limit.test_slow
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,53 @@ | ||
# name: test/sql/storage/buffer_manager/appending_table_exceeding_limit.test_slow | ||
# description: Test appending and checkpointing a table that exceeds buffer manager size | ||
# group: [buffer_manager] | ||
|
||
# load the DB from disk | ||
load __TEST_DIR__/test_table_exceeding_limit.db | ||
|
||
statement ok | ||
SET force_compression='uncompressed' | ||
|
||
statement ok | ||
SET memory_limit = '10MB' | ||
|
||
statement ok | ||
SET threads=1 | ||
|
||
statement ok | ||
CREATE TABLE test (a INTEGER, b INTEGER); | ||
|
||
statement ok | ||
INSERT INTO test VALUES (1, 10), (2, 20), (3, 30), (NULL, NULL) | ||
|
||
loop i 0 23 | ||
|
||
statement ok | ||
INSERT INTO test SELECT * FROM test | ||
|
||
endloop | ||
|
||
query IIII | ||
SELECT COUNT(*), COUNT(a), SUM(a), SUM(b) FROM test | ||
---- | ||
33554432 25165824 50331648 503316480 | ||
|
||
loop i 0 2 | ||
|
||
restart | ||
|
||
statement ok | ||
SET force_compression='uncompressed' | ||
|
||
statement ok | ||
SET memory_limit = '10MB' | ||
|
||
statement ok | ||
SET threads=1 | ||
|
||
query IIII | ||
SELECT COUNT(*), COUNT(a), SUM(a), SUM(b) FROM test | ||
---- | ||
33554432 25165824 50331648 503316480 | ||
|
||
endloop |
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
65 changes: 65 additions & 0 deletions
65
test/sql/storage/vacuum/repeated_deletes_and_checkpoints.test_slow
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,65 @@ | ||
# name: test/sql/storage/vacuum/repeated_deletes_and_checkpoints.test_slow | ||
# description: Test running repeated deletes and checkpoints | ||
# group: [vacuum] | ||
|
||
load __TEST_DIR__/repeated_deletes_and_checkpoints.db | ||
|
||
statement ok | ||
CREATE TABLE test (pk INT); | ||
|
||
statement ok | ||
INSERT INTO test SELECT * FROM generate_series(0, 1000000); | ||
|
||
statement ok | ||
CHECKPOINT; | ||
|
||
restart | ||
|
||
query I | ||
DELETE FROM test WHERE pk > 738645 AND pk < 978908; | ||
---- | ||
240262 | ||
|
||
query II | ||
SELECT COUNT(*), SUM(pk) FROM test; | ||
---- | ||
759739 293669140557 | ||
|
||
restart | ||
|
||
query I | ||
DELETE FROM test WHERE pk > 282475 AND pk < 522738; | ||
---- | ||
240262 | ||
|
||
query II | ||
SELECT COUNT(*), SUM(pk) FROM test; | ||
---- | ||
519477 196938097654 | ||
|
||
restart | ||
|
||
query I | ||
INSERT INTO test SELECT * FROM generate_series(1201414, 1201514); | ||
---- | ||
101 | ||
|
||
query II | ||
SELECT COUNT(*), SUM(pk) FROM test; | ||
---- | ||
519578 197059445518 | ||
|
||
restart | ||
|
||
query II | ||
SELECT COUNT(*), SUM(pk) FROM test; | ||
---- | ||
519578 197059445518 | ||
|
||
statement ok | ||
CHECKPOINT; | ||
|
||
query II | ||
SELECT COUNT(*), SUM(pk) FROM test; | ||
---- | ||
519578 197059445518 |