telstra/open-kilda

Patch update the flow: SQL Error: 1062, SQLState: 23000(HistoryBolt: Unhandled exception)

yuliiamir opened this issue · 1 comments

SQL Error: 1062, SQLState: 23000 has been caught several times during updating flow (patch). The update operation has been successfully executed(Successful update of the flow).

Details:
Data: Mar 4, 2024

f821e2ba-d259-4121-96d0-dbf18596dc30 : fn-tests-e9b545ef-326f-4be3-82b9-5e870cc23f89

Unhandled exception in org.openkilda.wfm.topology.history.bolts.HistoryBolt

Duplicate entry '7d1d6287a27fdcca898cf8d70eae7b84f2fb2952e4964c001e3f7dc932e11419' for key 'ix_task_id'

SQL Error: 1062, SQLState: 23000

Patch update the flow

Cor id:

dc639213-610b-45f0-a89c-3743d9c9fc68 : fn-tests-9215c416-fbba-4cbf-aaa7-3bb6732d2c5d
ddc2c7e6-4487-4dc9-a91b-0344cc16614b : fn-tests-f8735c40-e9ba-4765-abb4-ae89d14dcd39
261f6797-100b-45be-8df3-402645b62058 : fn-tests-49ba919f-7129-4bd5-b6b0-d75d58a19324

These issue happen because we have chained operations: in this case Patch can invoke Update. Both operations want to create their own event and the second fails. Actions from both operations are saved under the first event. We introduced a mechanism of skipping the second event creation, but seems like we didn't cover all cases. In any case, I suggest to change the way we create events to resolve all kinds of these issues.
Related issues: