Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant