You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2025/09/30 11:18:00 UTC

[jira] [Updated] (IGNITE-26555) Inconsistent read-only transaction timestamp behavior in embedded and client modes

     [ https://issues.apache.org/jira/browse/IGNITE-26555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Tupitsyn updated IGNITE-26555:
------------------------------------
    Description: 
* In embedded mode, *TxManagerImpl.beginReadOnlyTransaction* immediately retrieves current *observableTimestamp* to calculate *readTimestamp*
* In client mode, *ClientLazyTransaction* retrieves *observableTimestamp* from the tracker only in *ensureStarted* when the first transactional operation is performed.

As a result, the same user code will behave differently with embedded and client APIs:
{code:java}
    // ItThinClientTransactionsTest
    @ParameterizedTest
    @ValueSource(booleans = {true, false})
    void testReadOnly(boolean server) {
        Ignite ignite = server ? server() : client();
        KeyValueView<Integer, String> kvView = ignite.tables().table(TABLE_NAME).keyValueView(Integer.class, String.class);

        Transaction tx = ignite.transactions().begin(new TransactionOptions().readOnly(true));
        kvView.put(null, 123, "123");

        String val = kvView.get(tx, 123);
        assertNull(val);
    }
{code}

  was:
* In embedded mode, *TxManagerImpl.beginReadOnlyTransaction* immediately retrieves current *observableTimestamp* to calculate *readTimestamp*
* In client mode, *ClientLazyTransaction* retrieves *observableTimestamp* from the tracker only in *ensureStarted* when the first transactional operation is performed.

As a result, the same user code will behave differently with embedded and client APIs:
{code}
var tx = transactions.begin(readOnly = true);
view.upsert(null, tuple1);

// Fails on client, succeeds on server
assert view.get(tx, tuple1) == null;
{code}


> Inconsistent read-only transaction timestamp behavior in embedded and client modes
> ----------------------------------------------------------------------------------
>
>                 Key: IGNITE-26555
>                 URL: https://issues.apache.org/jira/browse/IGNITE-26555
>             Project: Ignite
>          Issue Type: Bug
>          Components: thin clients ai3
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Critical
>              Labels: ignite-3
>             Fix For: 3.2
>
>
> * In embedded mode, *TxManagerImpl.beginReadOnlyTransaction* immediately retrieves current *observableTimestamp* to calculate *readTimestamp*
> * In client mode, *ClientLazyTransaction* retrieves *observableTimestamp* from the tracker only in *ensureStarted* when the first transactional operation is performed.
> As a result, the same user code will behave differently with embedded and client APIs:
> {code:java}
>     // ItThinClientTransactionsTest
>     @ParameterizedTest
>     @ValueSource(booleans = {true, false})
>     void testReadOnly(boolean server) {
>         Ignite ignite = server ? server() : client();
>         KeyValueView<Integer, String> kvView = ignite.tables().table(TABLE_NAME).keyValueView(Integer.class, String.class);
>         Transaction tx = ignite.transactions().begin(new TransactionOptions().readOnly(true));
>         kvView.put(null, 123, "123");
>         String val = kvView.get(tx, 123);
>         assertNull(val);
>     }
> {code}



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