Files
Andrei Fedoseev 45b6bcc6d9 Keep a transaction on the connection that received WATCH or MULTI (#1756)
Retrying one of its commands on a new connection runs it outside of the
transaction: with Sentinel even without the retry option, since
SentinelReplication retries on its own. A transaction block then threw
with one command already written, and a CAS transaction overwrote a
change made after WATCH, because MULTI and EXEC ran on a connection
that watched nothing.

MultiExec::unwatch() now goes through the strategy before MULTI, a held connection that is no longer open fails instead of reconnecting outside the transaction, a StreamInitException releases it too, and replication holds getCurrent().

In CAS mode the first command initializes the transaction without sending MULTI, so MultiExec::unwatch() now checks for CAS too.
2026-11-12 09:40:49 -07:00
..