Alexander Lapin created IGNITE-17968:
----------------------------------------
Summary: Seems that mvDataStorage.scan doesn't return pending
removed value as writeIntent
Key: IGNITE-17968
URL: https://issues.apache.org/jira/browse/IGNITE-17968
Project: Ignite
Issue Type: Bug
Reporter: Alexander Lapin
Following test will work
{code:java}
@Test
public void testReadOnlyPendingWriteIntentSkipped() {
accounts.recordView().upsert(null, makeValue(1, 100.));
accounts.recordView().upsert(null, makeValue(2, 200.));
// Pending tx
Transaction tx = igniteTransactions.begin();
// accounts.recordView().delete(tx, makeKey(1));
accounts.recordView().upsert(tx, makeValue(2, 300.));
Transaction readOnlyTx = igniteTransactions.readOnly().begin();
Collection<Tuple> retrievedKeys =
accounts.recordView().getAll(readOnlyTx, List.of(makeKey(1), makeKey(2)));
validateBalance(retrievedKeys, 100., 200.);
} {code}
And following won't
@Test
public void testReadOnlyPendingWriteIntentSkipped() \{
accounts.recordView().upsert(null, makeValue(1, 100.));
accounts.recordView().upsert(null, makeValue(2, 200.));
// Pending tx
Transaction tx = igniteTransactions.begin();
accounts.recordView().delete(tx, makeKey(1));
accounts.recordView().upsert(tx, makeValue(2, 300.));
Transaction readOnlyTx = igniteTransactions.readOnly().begin();
Collection<Tuple> retrievedKeys =
accounts.recordView().getAll(readOnlyTx, List.of(makeKey(1), makeKey(2)));
validateBalance(retrievedKeys, 100., 200.);
}
Internally mvDataStorage.scan(readTimestamp) in
PartitionReplicaListener#processReadOnlyMultiEntryAction will skip such pending
removed entries.
It also worth to mention that writeIntetns that contain data (update pending
modification instead of remove one) works propertly. See
ItTxDistributedTestSingleNode#testReadOnlyGetWriteIntentResolutionUpdate and
ItTxDistributedTestSingleNode#testReadOnlyPendingWriteIntentSkippedTmp for more
details.
*Reproducers:*
ItTxDistributedTestSingleNode#testReadOnlyGetWriteIntentResolutionRemoveTmp
ItTxDistributedTestSingleNode#testReadOnlyPendingWriteIntentSkippedCombinedTmp
--
This message was sent by Atlassian Jira
(v8.20.10#820010)