0

Recently I've encountered a strange problem which I couldn't see any ideas based on my current knowledge.
Backend: Python3, Sqlalchemy, MySQL Config: read-committed, id auto-increment, cluster with 3 nodes. Query: insert into xxx values(xxx...) and then db.session.commit() Expect Result: New record id returned and mysql successfully create one record. Actually Result: New record id returned and no mysql record created and no binlog found.

I wonder: if something panic, the transcation should've rollback and no id should returned. What I missed?

lewdea
  • 11
  • 1

1 Answers1

0

Possibly one is overwriting the session with child processes, Connection problems with SQLAlchemy and multiple processes

Motomotes
  • 4,111
  • 1
  • 25
  • 24
  • Thank you for the answer. However, I'll say it might not be the case. This actually happens approximately 50 times out of 1000 insertions in production environment. Is there any possibility that the cluster may cause the problem? – lewdea Aug 22 '22 at 05:52