Error running keystone-manage token_flush
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Expired
|
Undecided
|
Unassigned |
Bug Description
I have 1.3 million rows in my keystone.token table, so I'm trying to trim this with the command keystone-manage token_flush. However, this command fails with the following message:
keystone-manage token_flush
/usr/lib/
m = re.match(
The real error is the following:
2014-07-17 13:16:19.830 8982 TRACE keystone Traceback (most recent call last):
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/bin/
2014-07-17 13:16:19.830 8982 TRACE keystone cli.main(
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib/
2014-07-17 13:16:19.830 8982 TRACE keystone CONF.command.
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib/
2014-07-17 13:16:19.830 8982 TRACE keystone token_manager.
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib/
2014-07-17 13:16:19.830 8982 TRACE keystone query.delete(
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone delete_op.exec_()
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone self._do_exec()
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone params=
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib/
2014-07-17 13:16:19.830 8982 TRACE keystone return f(self, *args, **kwargs)
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib/
2014-07-17 13:16:19.830 8982 TRACE keystone return super(Session, self).execute(
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone clause, params or {})
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone params)
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone compiled_sql, distilled_params
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone context)
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone exc_info
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone reraise(
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone context)
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone cursor.
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone self.errorhandl
2014-07-17 13:16:19.830 8982 TRACE keystone File "/usr/lib64/
2014-07-17 13:16:19.830 8982 TRACE keystone raise errorclass, errorvalue
2014-07-17 13:16:19.830 8982 TRACE keystone OperationalError: (OperationalError) (1206, 'The total number of locks exceeds the lock table size') 'DELETE FROM token WHERE token.expires < %s' (datetime.
2014-07-17 13:16:19.830 8982 TRACE keystone
It would be helpful if the client reported this error, rather than the unhelpful current error message.
tags: | added: db |
tags: |
added: database removed: db |
tags: |
added: sql removed: database |
This looks like a duplicate (effectively) of bug 1188378 .
Which release of OpenStack are you using? Icehouse? Havana? Earlier?
If you are tracking close to master (Juno), you could try this batch-delete code.
I'm unsure if we can backport this code to earlier releases because it is a significant change in functionality. The best bet (short of the code for bug 1188378 ) is likely to do more frequent cleanups of the token table. Initially you might need to do a manual cleanup.
If you don't mind answering the above questions, it might be solved moving forward and we can evaluate backporting the fix.