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

Seems that mvDataStorage.scan doesn't return pending removed value as writeIntent

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Following test will work

      @Test
      public void testReadOnlyGetWriteIntentResolutionUpdate() {
          accounts.recordView().upsert(null, makeValue(1, 100.));
      
          // Pending tx
          Transaction tx = igniteTransactions.begin();
          accounts.recordView().upsert(tx, makeValue(1, 300.));
      
          // Update
          Transaction readOnlyTx = igniteTransactions.readOnly().begin();
          assertEquals(100., accounts.recordView().get(readOnlyTx, makeKey(1)).doubleValue("balance"));
      }

      And following won't

      @Test
      public void testReadOnlyGetWriteIntentResolutionRemove() {
          accounts.recordView().upsert(null, makeValue(1, 100.));
      
          // Pending tx
          Transaction tx = igniteTransactions.begin();
          accounts.recordView().delete(tx, makeKey(1));
      
          // Remove.
          Transaction readOnlyTx = igniteTransactions.readOnly().begin();
          assertEquals(100., accounts.recordView().get(readOnlyTx, makeKey(1)).doubleValue("balance"));
      } 

      Internally mvDataStorage.scan(readTimestamp) in PartitionReplicaListener#processReadOnlyMultiEntryAction will skip such pending removed entries.

      Please pay attention that writeIntetns that contain data (update pending modification instead of remove one) works propertly. See ItTxDistributedTestSingleNode#testReadOnlyGetWriteIntentResolutionUpdate and ItTxDistributedTestSingleNode#testReadOnlyPendingWriteIntentSkipped for more details.

      Reproducers:

      ItTxDistributedTestSingleNode#testReadOnlyGetWriteIntentResolutionRemove

      ItTxDistributedTestSingleNode#testReadOnlyPendingWriteIntentSkippedCombined

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sdanilov Semyon Danilov
            alapin Alexander Lapin
            Roman Puchkovskiy Roman Puchkovskiy
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 - 0.5h
                0.5h

                Slack

                  Issue deployment