Nova is issuing unnecessary ROLLBACK statements to MySQL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Invalid
|
Low
|
Unassigned | ||
OpenStack Compute (nova) |
Invalid
|
Low
|
Unassigned | ||
oslo.db |
Expired
|
Low
|
Unassigned |
Bug Description
I'm not sure exactly where this is coming from yet, but Nova is issuing a "ROLLBACK" to MySQL after nearly every SELECT statement, even though I think the connection should be autocommit mode. This is unnecessary and wastes time (network roundtrip) and resources (database CPU cycles).
I suspect this is getting generated by sqlalchemy when ever a connection is handed back to the pool, since the number of rollbacks roughly coincides with the number of "select 1" statements that I see in the logs. Those are issued by the MySQLPingListener when a connection is taken out of the pool.
I opened a bug already for the unnecessary "select 1" statements, but I'm opening this as a separate bug. If someone finds a way to fix both at once, that'd be great.
Changed in nova: | |
status: | New → Confirmed |
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | nobody → Devananda (devananda) |
Changed in cinder: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | Devananda van der Veen (devananda) → nobody |
Changed in oslo.db: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in nova: | |
status: | Confirmed → Invalid |
Changed in cinder: | |
status: | Confirmed → Invalid |
Changed in oslo.db: | |
status: | Triaged → Incomplete |
Attaching a sample of query log showing the "rollback" statements. For reference, here are the query counts in the sample. This was taken with long_query_time=0, in devstack, during a call to "nova add-floating-ip".
grep -c '# Query_time: ' log-sample. floating- ip-create. log ^UPDATE| ^DELETE' log-sample. floating- ip-create. log floating- ip-create. log floating- ip-create. log
35
grep -ciP '^INSERT|
1
grep -ciP '^SELECT [^1]' log-sample.
11
grep -cP '^rollback' log-sample.
11