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

[Bugfix] Prepare failed when the transaction still in processing #384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gohalo
Copy link

@gohalo gohalo commented Sep 10, 2024

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Which issues of this PR fixes :

Fixes #383

Problem Summary(Required) :

When invoking the prepare method for some transaction, there maybe get some chance failed, with the following code.

Status TransactionMgr::commit_transaction(const HttpRequest* req, std::string* resp) {
    // ......
        if (!ctx->lock.try_lock()) {
            st = Status::TransactionInProcessing("Transaction in processing, please retry later");
            *resp = _build_reply(label, TXN_COMMIT, st);
            return st;
        }
    // ......
}

And the flink connector just throw an exception without retry.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function

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

Successfully merging this pull request may close these issues.

[Bug] Write to StarRocks failed occasionally.
1 participant