Running the periodic tasks from method _start_maintenance_task(self) of
networking-odl/networking_odl/journal/worker.py
Steps to reproduce the issue:
1)Disconnect ODL controller from openstack neutron and create resources such as networks, port, subnets, security groups in devstack setup.
2)Entries in the journal with "failed" state:
Resource failed entry in journal;
mysql> select * from opendaylightjournal;
+--------+-------------+--------------------------------------+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-------------+---------------------+------------+
| seqnum | object_type | object_uuid | operation | data | state | retry_count | last_retried | version_id |
+--------+-------------+--------------------------------------+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+-------------+---------------------+------------+
| 3192 | network | 9ae134f9-3466-4298-9176-7923293e6e59 | create | 0x80059552020000000000007D94288C026964948C2439616531333466392D333436362D343239382D393137362D373932333239336536653539948C046E616D65948C086E6574776F726B73948C0974656E616E745F6964948C206236383866376638376633333463653139636663633131363432613035643930948C0E61646D696E5F73746174655F757094888C036D7475944DAA058C06737461747573948C06414354495645948C077375626E657473945D948C0673686172656494898C0A70726F6A6563745F69649468068C15706F72745F73656375726974795F656E61626C656494888C0D716F735F706F6C6963795F6964944E8C0F726F757465723A65787465726E616C94898C1570726F76696465723A6E6574776F726B5F74797065948C0576786C616E948C1970726F76696465723A706879736963616C5F6E6574776F726B944E8C1870726F76696465723A7365676D656E746174696F6E5F6964944B078C17617661696C6162696C6974795F7A6F6E655F68696E7473945D948C0A69735F64656661756C7494898C12617661696C6162696C6974795F7A6F6E6573945D948C12697076345F616464726573735F73636F7065944E8C12697076365F616464726573735F73636F7065944E8C10766C616E5F7472616E73706172656E74944E8C0B6465736372697074696F6E948C00948C0474616773945D948C0A637265617465645F6174948C14323032312D30362D32385430353A34373A35305A948C0A757064617465645F6174948C14323032312D30362D32385430353A34373A35305A948C0F7265766973696F6E5F6E756D626572944B01752E | failed | 5 | 2021-06-28 05:57:09 | 61 |
3)These entries will be left in the journal table until the ODL and Openstack connections is established.
4)Wait for recovery task to run from maintenance periodic task.
5)Journal recovery task not able to sync the failed entries from journal due to following error:
ERROR networking_odl.journal.periodic_task [None req-f0adaef8-33e6-4ccd-b8a9-8ffe8c8b59fb None None] Failed during periodic task operation journal_recovery.: sqlalchemy.exc.InvalidRequestError: Object '' is already attached to session '105' (this is '114')
Thanks for reporting this issue, could you tell which Openstack/ Neutron/ ODL versions You used for reproduction?