Mirza Aliev created IGNITE-18266:
------------------------------------

             Summary: Fix problem with RO get after several puts, that the last 
applied value is not visible for RO read
                 Key: IGNITE-18266
                 URL: https://issues.apache.org/jira/browse/IGNITE-18266
             Project: Ignite
          Issue Type: Bug
            Reporter: Mirza Aliev


The follow scenario when RO get after several puts, that the last applied value 
is not visible for RO read  

{code:java}
    @Test
    public void testRoGetWithSpecifiedTimestampFromSecondaryStore() throws 
ExecutionException, InterruptedException {
        IgniteImpl node = node(0);

        Table table = startTable(node, TABLE_NAME);

        InternalTable internalTable = ((TableImpl) table).internalTable();

        Row keyValueRow = createKeyValueRow(1, 1, "some string row" + 1);

        Row keyValueRow2 = createKeyValueRow(1, 2, "some string row" + 2);

        Transaction tx1 =  node.transactions().begin();

        internalTable.insert(keyValueRow, (InternalTransaction) tx1).get();

        tx1.commit();

        Transaction tx2 =  node.transactions().begin();

        internalTable.insert(keyValueRow2, (InternalTransaction) tx2).get();

        tx2.commit();

        Publisher<BinaryRow> res = internalTable.scan(0, new 
HybridTimestamp(Long.MAX_VALUE - 1000, 0), node.node());

        CountDownLatch latch = new CountDownLatch(1);

        List<ByteBuffer> list = new ArrayList<>();

        res.subscribe(new Subscriber<BinaryRow>() {
            @Override
            public void onSubscribe(Subscription subscription) {
                subscription.request(100);
            }

            @Override
            public void onNext(BinaryRow item) {
                System.out.println("RESULT FROM SCAN$# = " +  
item.valueSlice());
                list.add(item.valueSlice());
            }

            @Override
            public void onError(Throwable throwable) {
                System.out.println("ON ERROR$#");
            }

            @Override
            public void onComplete() {
                latch.countDown();
                System.out.println("ON COMPLETE#");
            }
        });

        latch.await();

        assertEquals(1, list.size());

        assertEquals(list.get(0), keyValueRow2.valueSlice());
    }
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to