Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Since read only transactions may throw TransactionFailedRetriableException, provide method to retry them #5156

Open
carrino opened this issue Dec 14, 2020 · 0 comments

Comments

@carrino
Copy link
Contributor

carrino commented Dec 14, 2020

Also provide some doc that this retriable version should not be used for long running read only transactions.
<T, E extends Exception> T runTaskReadOnlyWithRetry(TransactionTask<T, E> task) throws E;

lockImmutableTsOnReadOnlyTransactions = true may cause read only txn to throw.

    @Override
    public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionReadOnly(
            C condition, ConditionAwareTransactionTask<T, C, E> task) throws E {
        if (transactionConfig.get().lockImmutableTsOnReadOnlyTransactions()) {
            return runTaskWithConditionThrowOnConflict(condition, task);
        } else {
            return runTaskWithConditionReadOnlyInternal(condition, task);
        }
    }

which will throw in SnapshotTransaction.throwIfImmutableTsOrCommitLocksExpired

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant