** Changed in: keystone
       Status: Fix Committed => Fix Released

** Changed in: keystone
    Milestone: None => juno-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1324076

Title:
  Duplicated DELETE queries on sql backend

Status in OpenStack Identity (Keystone):
  Fix Released

Bug description:
  When trying to delete a consumer with OS-OAUTH1 extension, Keystone
  sends twice a same delete sql query.

  After a quick glance, it appears to me that this bug concerns several
  keystone objects, at least request_token and access_token (OS-OAUTH1)
  and identity_provider (OS-FEDERATION)

  Example logs from keystone:

      INFO sqlalchemy.engine.base.Engine [-] SELECT consumer.id AS consumer_id, 
consumer.description AS consumer_description, consumer.secret AS 
consumer_secret, consumer.extra AS consumer_extra
      FROM consumer
      WHERE consumer.id = %s
      INFO sqlalchemy.engine.base.Engine [-] 
('0cd89a4e04eb4066a78bd9e8727baa24',)
      DEBUG sqlalchemy.engine.base.Engine [-] Col ('consumer_id', 
'consumer_description', 'consumer_secret', 'consumer_extra') __init__ 
/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/result.py:274
      DEBUG sqlalchemy.engine.base.Engine [-] Row 
('0cd89a4e04eb4066a78bd9e8727baa24', None, 'b196d850e18c4ea984e37861b6789966', 
'{}') process_rows 
/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/result.py:771
      INFO sqlalchemy.engine.base.Engine [-] DELETE FROM consumer WHERE 
consumer.id = %s
      INFO sqlalchemy.engine.base.Engine [-] 
('0cd89a4e04eb4066a78bd9e8727baa24',)
      INFO sqlalchemy.engine.base.Engine [-] DELETE FROM consumer WHERE 
consumer.id = %s
      INFO sqlalchemy.engine.base.Engine [-] 
('0cd89a4e04eb4066a78bd9e8727baa24',)
      /usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py:116: 
SAWarning: DELETE statement on table 'consumer' expected to delete 1 row(s); 0 
were matched.  Please set confirm_deleted_rows=False within the mapper 
configuration to prevent this warning.
        cached_connections, mapper, table, delete)
      INFO sqlalchemy.engine.base.Engine [-] COMMIT
      INFO eventlet.wsgi.server [-] 127.0.0.1 - - [28/May/2014 13:02:33] 
"DELETE /v3/OS-OAUTH1/consumers/0cd89a4e04eb4066a78bd9e8727baa24 HTTP/1.1" 204 
103 0.167622

  The problem seems to come from this code (almost identicaly on several
  places), where we can see the two delete actions:

          consumer_ref = self._get_consumer(session, consumer_id)
          q = session.query(Consumer)
          q = q.filter_by(id=consumer_id)
          q.delete(False)
          session.delete(consumer_ref)

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1324076/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to