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

Write intent resolution for RW transactions

    XMLWordPrintableJSON

Details

    Description

      Motivation
      Currently, RW transaction resolves only write intents by itself. If RW transaction steps on a write intent from another transaction, an assertion error will appear.

      	// Should never happen, currently, locks prevent reading another transaction intents during RW requests.
          throw new AssertionError("Mismatched transaction id, expectedTxId={" + txId + "},"
                  + " actualTxId={" + retrievedResultTxId + '}');
      

      Really, we will be able to leave write intent in case when node restarted before it can handle cleanup message. Now, we workaround the case by scanning storage for logging for write intent and commit them on start:

              try (PartitionTimestampCursor cursor = partitionDataStorage.scan(HybridTimestamp.MAX_VALUE)) {
                  while (cursor.hasNext()) {
                      ReadResult readResult = cursor.next();
      
                      if (readResult.isWriteIntent()) {
                          txsPendingRowIds.computeIfAbsent(readResult.transactionId(), key -> new TreeSet<>()).add(readResult.rowId());
                      }
                  }
              }
      

      But this is very time-consuming.

      Attachments

        Issue Links

          Activity

            People

              v.pyatkov Vladislav Pyatkov
              v.pyatkov Vladislav Pyatkov
              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 - 8.5h
                  8.5h