Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Docs Required, Release Notes Required
Description
There are a few concurrency issues with the write intent tracking code
1. See PendingRows class. The value is a TreeSet, which is not a concurrent collection. Thus it's not safe to do the read this way:
public Set<RowId> getPendingRowIds(UUID txId) { return txsPendingRowIds.getOrDefault(txId, EMPTY_SET); }
2. See StorageUpdateHandler.handleTransactionCleanup. We first get a collection of rows for a specific transaction from the map, then process the rows in the storage, then remove the whole transaction entry from the map:
public void handleTransactionCleanup(UUID txId, boolean commit, @Nullable HybridTimestamp commitTimestamp) { Set<RowId> pendingRowIds = pendingRows.getPendingRowIds(txId); handleTransactionCleanup(pendingRowIds, commit, commitTimestamp, () -> pendingRows.removePendingRowIds(txId)); }
If a parallel thread adds more write intents to the map, we'll silently lose them.
Attachments
Issue Links
- is depended upon by
-
IGNITE-20041 Asynchronous writeIntent cleanup on write intent resolution
-
- Resolved
-
- links to