Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
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
Issue Links
- links to