DataShard: EvWrite doesn't handle immediate writes with TxId=0 correctly #14553
Labels
area/datashard
Issues related to datashard tablets (relational table partitions)
bug
Something isn't working
It was discovered that immediate EvWrite doesn't work properly when volatile transactions are present. We want to avoid allocating TxIds on the fast path for immediate writes, however when immediate writes conflict with volatile transactions that are not committed in the LocalDB yet, we need to upgrade them to an uncommitted write that is paired with a committed volatile tx record with a proper dependency graph. Uncommitted writes need a global TxId, which needs to be allocated on demand. The current EvWrite implementation was partially copied from BulkUpsert, which used TNeedGlobalTxId exception to indicate that operation needs to be restarted with an allocated global TxId, and EvWrite implementation handles it in the same way. However, unlike BulkUpsert the EvWrite implementation uses a UserDb abstraction, which actually never throws TNeedGlobalTxId. This causes such writes to break in subtle ways and may short circuit current undecided volatile writes, making them disappear.
The text was updated successfully, but these errors were encountered: