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

[Fix](recycler) Further fix for #47475 #47486

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

Conversation

Yukang-Lian
Copy link
Collaborator

@Yukang-Lian Yukang-Lian commented Jan 29, 2025

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #47475

Problem Summary:

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

@Thearas
Copy link
Contributor

Thearas commented Jan 29, 2025

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?

@Yukang-Lian
Copy link
Collaborator Author

run buildall

// Tmp rowsets may not be recycled in recycle_tablet correctly,
// here we can not skip recycling them
if (!is_recycle_tmp_rowset) {
{
Copy link
Contributor

@gavinchou gavinchou Jan 30, 2025

Choose a reason for hiding this comment

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

redundant indention (extra curly brace)

Comment on lines +225 to +226
int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
bool is_recycle_tmp_rowset = false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use enum class

enum class RowsetRecyclingState {
    FORMAL_ROWSET,
    TMP_ROWSET,
};
    int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
                           RowsetRecyclingState type);

Comment on lines +225 to +226
int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
bool is_recycle_tmp_rowset = false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use enum class

enum class RowsetRecyclingState {
    FORMAL_ROWSET,
    TMP_ROWSET,
};
    int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
                           RowsetRecyclingState type);

Comment on lines +225 to +226
int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
bool is_recycle_tmp_rowset = false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use enum class

enum class RowsetRecyclingState {
    FORMAL_ROWSET,
    TMP_ROWSET,
};
    int delete_rowset_data(const std::vector<doris::RowsetMetaCloudPB>& rowsets,
                           RowsetRecyclingState type);

Comment on lines +1476 to +1477
// Tmp rowsets may not be recycled in recycle_tablet correctly,
// here we can not skip recycling them
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Tmp rowsets may not be recycled in recycle_tablet correctly,
// here we can not skip recycling them
// we have to treat tmp rowset as "orphans" that may not related to any existing tablets
// due to aborted schema change.

@@ -1499,7 +1504,7 @@ int InstanceRecycler::delete_rowset_data(const std::vector<doris::RowsetMetaClou
std::vector<std::pair<int64_t, std::string>> index_ids;
// default format as v1.
InvertedIndexStorageFormatPB index_format = InvertedIndexStorageFormatPB::V1;

int get_ret = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

suggested naming inverted_index_get_ret

@@ -1562,7 +1566,8 @@ int InstanceRecycler::delete_rowset_data(const std::vector<doris::RowsetMetaClou
file_paths.push_back(inverted_index_path_v1(tablet_id, rowset_id, i,
index_id.first, index_id.second));
}
} else if (!index_ids.empty()) {
} else if (!index_ids.empty() || get_ret == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

add comment "we treat schema not found as if it has a v2 format inverted index to reduce chance of data leakage"

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

Successfully merging this pull request may close these issues.

4 participants