Database deadlock in ceilometer-collector when ceilometer-expirer is running
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Low
|
ZhiQiang Fan | ||
Kilo |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Seeing database deadlock error in ceilometer-
See two errors 1.) and 2.) below
1.) Deadlock error:
Deadlock found when trying to get lock; try restarting transaction
2015-03-12 04:30:03.875 26730 ERROR ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
[...]
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2015-03-12 04:30:03.875 26730 TRACE ceilometer.
2.) Savepoint Error
Which is followed by savepoint error ('SAVEPOINT sa_savepoint_2 does not exist)
2015-03-12 04:30:04.185 26730 ERROR ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
[...]
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
2015-03-12 04:30:04.185 26730 TRACE ceilometer.
Looks like ceilometer-expirer is causing database deadlock to happen.
Possible solution: Changing the expirer to delete from one table at a time and then doing a commit, instead of deleting from all the tables sample, resource and meter in a single transaction
description: | updated |
summary: |
- ceilometer expirer causes database deadlock when collector is running + Database deadlock in ceilometer-collector when ceilometer-expirer is + running |
Changed in ceilometer: | |
assignee: | nobody → Ashwin Agate (ashwin-agate) |
Changed in ceilometer: | |
assignee: | Ashwin Agate (ashwin-agate) → ZhiQiang Fan (aji-zqfan) |
Changed in ceilometer: | |
milestone: | none → liberty-rc1 |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | liberty-rc1 → 5.0.0 |
can you try to modify the method of clear_expired_ metering_ data (https:/ /github. com/openstack/ ceilometer/ blob/b5cfcb620c f8717e9eeae20c6 2561b5956ac94a1 /ceilometer/ storage/ impl_sqlalchemy .py#L346 ), change all synchronize_ session= False to synchronize_ session= "fetch" and verify it?
Thanks