Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
If a transaction was committed/aborted and for any reason the cleanup operation was not performed on a node, the write intent entries would still be present in the storage.
When an RO transaction sees write intents, no matter on primary or on any other node, it performs write intent resolution and returns the correct result.
When an RW transaction sees write intents, we can get an exception.
Imagine the case where a finished transaction left its write intents in the storage of all nodes A, B and C. A is primary.
An RO transaction is executed on the primary A, it kicks off an async cleanup (IGNITE-20041).
The cleanup is a local task (not distributed to the replication group), thus only the A's storage is cleaned. B and C storages still contain the same write intent.
Now an RW transaction starts. It sees no write intents on A, executes its action and the action is replicated to B and C. Execution of this task on B and C will result in a storage exception since it's not allowed to have more than one write intent per row.
Definition of Done
The nodes of the replication group should perform cleanup of their storages when they receive an UpdateCommand, before adding new write intents.
Implementation details
We can extend the update command with the timestamp of the latest commit on primary.
If the nodes of the replication group see a write intent in their storage, they will:
- commit the write intent if the UpdateCommand`s latestCommitTimestamp is greater than the commit timestamp of latest committed entry.
- abort the write intent if he UpdateCommand`s latestCommitTimestamp is equal to the commit timestamp of latest committed entry.
Attachments
Issue Links
- causes
-
IGNITE-20609 Move last commit timestamp into BinaryRowMessage
- Resolved
- is related to
-
IGNITE-20446 Perform read before executing the Upsert operation
- Resolved
- relates to
-
IGNITE-20041 Asynchronous writeIntent cleanup on write intent resolution
- Resolved
-
IGNITE-20395 Clean up write intents for RW transaction on primary
- Resolved
- links to