Skip to content

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

Open
gohalo wants to merge 1 commit intoStarRocks:mainfrom
gohalo:bugfix/prepare
Open

[Bugfix] Prepare failed when the transaction still in processing#384
gohalo wants to merge 1 commit intoStarRocks:mainfrom
gohalo:bugfix/prepare

Conversation

@gohalo
Copy link
Copy Markdown

@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

@shengjk
Copy link
Copy Markdown

shengjk commented Dec 25, 2025

Is there a follow-up?

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.

2 participants