Skip to content
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

sql: DROP never completes #31671

Closed
knz opened this issue Oct 20, 2018 · 3 comments
Closed

sql: DROP never completes #31671

knz opened this issue Oct 20, 2018 · 3 comments
Labels
A-schema-changes A-tools-hibernate Issues that pertain to Hibernate integration. C-investigation Further steps needed to qualify. C-label will change.
Milestone

Comments

@knz
Copy link
Contributor

knz commented Oct 20, 2018

Describe the problem

Failure in the Hibernate test org.hibernate.test.jpa.lock.RepeatableReadTest.testStaleNonVersionedInstanceFoundOnLock

To Reproduce

  • set up roachprod cluster + Hibernate test as documented by Bram elsewhere
  • ensure that SQL statement logging is enabled via cluster setting
  • run ../gradlew test -Pdb=cockroach --info --tests org.hibernate.test.jpa.lock.RepeatableReadTest.testStaleNonVersionedInstanceFoundOnLock

Observe: the test hangs on the DROP statement.

Then collect the SQL execute log to observe details.

Expected behavior

The test should complete (either successfully or with error, this is not relevant here).

Additional data / screenshots

Here is the SQL execute log:

"CREATE TABLE ejb3_item (item_id INT8 NOT NULL, vers INT8 NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY (item_id))" {} 6.690 0 ""
"CREATE TABLE ejb3_part (part_id INT8 NOT NULL, item_id INT8 NOT NULL, name VARCHAR(255) NOT NULL, stock_num VARCHAR(255) NOT NULL, unit_price DECIMAL(19,2) NOT NULL, PRIMARY KEY (part_id))" {} 6.391 0 ""
"CREATE TABLE jpa_myentity (id INT8 NOT NULL, \"TYPE\" VARCHAR(255) NOT NULL, name VARCHAR(255), surname VARCHAR(255), somesubproperty VARCHAR(255), other INT8, PRIMARY KEY (id))" {} 6.366 0 ""
"ALTER TABLE IF EXISTS ejb3_part ADD CONSTRAINT fkqlvf6payfo203ey0aqmxhpke4 FOREIGN KEY (item_id) REFERENCES ejb3_item" {} 1.011 0 "foreign key requires an existing index on columns (\"item_id\")"
"ALTER TABLE IF EXISTS jpa_myentity ADD CONSTRAINT fk85p98ksfchdb4sxbrji3tv6ws FOREIGN KEY (other) REFERENCES jpa_myentity" {} 1.296 0 "foreign key requires an existing index on columns (\"other\")"
"SHOW transaction_isolation" {} 0.841 1 ""
"SELECT max(part_id) FROM ejb3_part" {} 9.967 1 ""
"SELECT max(item_id) FROM ejb3_item" {} 16.780 1 ""
"INSERT INTO ejb3_item(vers, name, item_id) VALUES ($1, $2, $3)" {$1:"0", $2:"'EJB3 Specification'", $3:"1"} 0.995 1 ""
"INSERT INTO ejb3_part(item_id, name, stock_num, unit_price, part_id) VALUES ($1, $2, $3, $4, $5)" {$1:"1", $2:"'Lock Modes'", $3:"'3.3.5.3'", $4:"0", $5:"1"} 0.896 1 ""
"SELECT part0_.part_id AS part_id1_1_0_, part0_.item_id AS item_id2_1_0_, part0_.name AS name3_1_0_, part0_.stock_num AS stock_nu4_1_0_, part0_.unit_price AS unit_pri5_1_0_ FROM ejb3_part AS part0_ WHERE part0_.part_id = $1" {$1:"1"} 1.043 1 ""
= 3" {} 0.444 0 ""
"SET application_name = 'PostgreSQL JDBC Driver'" {} 0.230 0 ""
"SELECT part0_.part_id AS part_id1_1_0_, part0_.item_id AS item_id2_1_0_, part0_.name AS name3_1_0_, part0_.stock_num AS stock_nu4_1_0_, part0_.unit_price AS unit_pri5_1_0_ FROM ejb3_part AS part0_ WHERE part0_.part_id = $1" {$1:"1"} 1.052 1 ""
"UPDATE ejb3_part SET item_id = $1, name = $2, stock_num = $3, unit_price = $4 WHERE part_id = $5" {$1:"1", $2:"'Lock Mode Types'", $3:"'3.3.5.3'", $4:"0.00", $5:"1"} 1.480 1 ""
"SELECT part0_.part_id AS part_id1_1_0_, part0_.item_id AS item_id2_1_0_, part0_.name AS name3_1_0_, part0_.stock_num AS stock_nu4_1_0_, part0_.unit_price AS unit_pri5_1_0_ FROM ejb3_part AS part0_ WHERE part0_.part_id = $1" {$1:"1"} 0.994 1 ""
"ALTER TABLE IF EXISTS ejb3_part DROP CONSTRAINT IF EXISTS fkqlvf6payfo203ey0aqmxhpke4" {} 0.895 0 ""
"ALTER TABLE IF EXISTS jpa_myentity DROP CONSTRAINT IF EXISTS fk85p98ksfchdb4sxbrji3tv6ws" {} 0.695 0 ""
"DROP TABLE IF EXISTS ejb3_item CASCADE" {} 11.036 0 ""
"DROP TABLE IF EXISTS ejb3_part CASCADE" {} 8.995 0 ""
@knz
Copy link
Contributor Author

knz commented Oct 20, 2018

Note the execute log does not include explicit BEGIN/COMMIT markers. It is unknown whether the test uses transactions.

@knz knz added C-investigation Further steps needed to qualify. C-label will change. A-schema-changes labels Oct 20, 2018
@knz knz added this to the 2.2 milestone Oct 20, 2018
@knz knz added the A-tools-hibernate Issues that pertain to Hibernate integration. label Oct 20, 2018
@knz
Copy link
Contributor Author

knz commented Oct 20, 2018

cc @vivekmenezes for triage

@jordanlewis
Copy link
Member

@rafiss does this still hang in Hibernate? I'm assuming not, so going to close, but would be curious if you've seen this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-schema-changes A-tools-hibernate Issues that pertain to Hibernate integration. C-investigation Further steps needed to qualify. C-label will change.
Projects
None yet
Development

No branches or pull requests

2 participants