-
Notifications
You must be signed in to change notification settings - Fork 848
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
Fix for deadlock between select and drop_chunks #929
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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,68 @@ | ||
Parsed test spec with 2 sessions | ||
|
||
starting permutation: s1a s1b s2a s2b | ||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); | ||
drop_chunks | ||
|
||
|
||
step s1b: COMMIT; | ||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; | ||
typ loc mtim | ||
|
||
step s2b: COMMIT; | ||
|
||
starting permutation: s1a s2a s1b s2b | ||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); | ||
drop_chunks | ||
|
||
|
||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; <waiting ...> | ||
step s1b: COMMIT; | ||
step s2a: <... completed> | ||
typ loc mtim | ||
|
||
step s2b: COMMIT; | ||
|
||
starting permutation: s1a s2a s2b s1b | ||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); | ||
drop_chunks | ||
|
||
|
||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; <waiting ...> | ||
step s2a: <... completed> | ||
ERROR: canceling statement due to user request | ||
step s2b: COMMIT; | ||
step s1b: COMMIT; | ||
|
||
starting permutation: s2a s1a s1b s2b | ||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; | ||
typ loc mtim | ||
|
||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); <waiting ...> | ||
step s1a: <... completed> | ||
ERROR: canceling statement due to user request | ||
step s1b: COMMIT; | ||
step s2b: COMMIT; | ||
|
||
starting permutation: s2a s1a s2b s1b | ||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; | ||
typ loc mtim | ||
|
||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); <waiting ...> | ||
step s2b: COMMIT; | ||
step s1a: <... completed> | ||
drop_chunks | ||
|
||
|
||
step s1b: COMMIT; | ||
|
||
starting permutation: s2a s2b s1a s1b | ||
step s2a: SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; | ||
typ loc mtim | ||
|
||
step s2b: COMMIT; | ||
step s1a: select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); | ||
drop_chunks | ||
|
||
|
||
step s1b: COMMIT; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
##github issue 865 deadlock between select and drop chunks | ||
|
||
setup | ||
{ | ||
CREATE TABLE ST ( sid int PRIMARY KEY, typ text) ; | ||
CREATE TABLE SL ( lid int PRIMARY KEY, loc text) ; | ||
CREATE TABLE DT ( sid int REFERENCES ST(sid), lid int REFERENCES SL(lid), mtim timestamp with time zone ) ; | ||
SELECT create_hypertable('DT', 'mtim', chunk_time_interval => interval '1 day'); | ||
INSERT INTO SL VALUES (1, 'LA'); | ||
INSERT INTO ST VALUES (1, 'T1'); | ||
INSERT INTO DT (sid,lid,mtim) | ||
SELECT 1,1, generate_series( '2018-12-01 00:00'::timestamp, '2018-12-31 12:00','1 minute') ; | ||
} | ||
|
||
teardown | ||
{ DROP TABLE DT; DROP table ST; DROP table SL; } | ||
|
||
session "s1" | ||
setup { BEGIN;} | ||
step "s1a" { select drop_chunks( '2018-12-25 00:00'::timestamptz, 'dt'); } | ||
step "s1b" { COMMIT; } | ||
|
||
session "s2" | ||
setup { BEGIN; } | ||
step "s2a" { SELECT typ, loc, mtim FROM DT , SL , ST WHERE SL.lid = DT.lid AND ST.sid = DT.sid AND mtim >= '2018-12-01 03:00:00+00' AND mtim <= '2018-12-01 04:00:00+00' AND typ = 'T1' ; } | ||
step "s2b" { COMMIT; } | ||
|
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might consider making this it's own static function that returns a list given that it's a block anyway. But up to you.