Skip to content

Conversation

@hust-hhb
Copy link
Contributor

What problem does this PR solve?

Related PR: #37670

Problem Summary:
When the number of tablet is big, get delete bitmap update lock may cost over 5 seconds, which will lead to transaction timeout, we should create a new transaction to get the remaining tablet stats.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hust-hhb
Copy link
Contributor Author

run buildall

zhannngchen
zhannngchen previously approved these changes Dec 3, 2024
Copy link
Contributor

@zhannngchen zhannngchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Dec 3, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2024

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2024

PR approved by anyone and no changes requested.


void internal_get_tablet_stats(MetaServiceCode& code, std::string& msg, Transaction* txn,
void internal_get_tablet_stats(MetaServiceCode& code, std::string& msg,
std::unique_ptr<Transaction>& txn, std::shared_ptr<TxnKv>& txn_kv,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a behavior change, semantic changed, txn atomic is not garanteed if we create a new txn.
Fix where this internal_get_tablet_stats() is called if we met TXN_TOO_OLD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gavinchou already change the code, take a look please

@github-actions github-actions bot removed the approved Indicates a PR has been approved by one committer. label Dec 3, 2024
@hust-hhb
Copy link
Contributor Author

hust-hhb commented Dec 4, 2024

run buildall

@hust-hhb
Copy link
Contributor Author

hust-hhb commented Dec 4, 2024

run buildall

code = MetaServiceCode::OK;
txn = nullptr;
retry++;
err = txn_kv_->create_txn(&txn);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overwrite the txn cannot modify the "delete_bitmap_upldate_lock"

@hust-hhb hust-hhb closed this Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants