Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-20379

Concurrency issues with write intent tracking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-beta2
    • 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

          Activity

            People

              ksizov  Kirill Sizov
              ksizov  Kirill Sizov
              Alexander Lapin Alexander Lapin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m