This issue is created as a follow-up of https://bugzilla.redhat.com/show_bug.cgi?id=1999650 . Specifically, this issue is intended to ensure that the C and python IDL clients for OVSDB will connect to the new leader when a transaction fails due to a RAFT leadership change. Currently, the initial transaction failure is reported via the IDL to the client, and the client will likely re-attempt the transaction. However, behind the scenes, the initial transaction was actually successful on the new leader, so re-attempting the transaction will fail since it will appear that we are inserting the same record a second time.
I'm not actually sure what this issue is about. I remember discussing it and I remember that it made some sense at the point of creation, but I think it is missing some context. For the problem statement in comment #0, the application supposed to re-check if transaction still applies after the transaction failed for the first time. It is necessary, because there is a chance that transaction will not fail and just be executed twice in case it doesn't violate database consistency. And the IDL clients do actually re-connect to a new leader if they are configured with leader-only connections. It would be nice if the transaction didn't fail, but that's the separate issue. It might be better to actually not re-connect to a new leader while there is an open transaction. In this case the client should receive a successful transaction reply once the transaction is committed. But that seems to be an opposite to what this BZ is asking for. I'll close this one for now. We may open an FDP Jira issue for keeping the connection to the old leader while there is an open transaction instead.