-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Fix](recycler) Fix recycler fail when dealing with rowset [0-1] #47324
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
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ed by some bugs (#47475) ### Background: 1. In PR #46798, we modified the way to recycle tablets because if there is a vault that fails to initialize, the original way of recycling tablets would directly return -1 when encountering a failed vault due to not finding an accessor, resulting in an inability to recycle normally. PR #46798 changed this to traverse rowsets and obtain accessors based on resource IDs. Compared to the previous method of directly returning -1 and not recycling anything, this approach can recycle as many rowsets as possible as long as the vault is normal. 2. The aforementioned PR modified the way of recycling tablets. Due to historical reasons, [0-1] rowsetPB does not have a resource ID. Since we assumed that all rowsetPBs have a resource ID, once there is no resource ID, it would return -1, causing the recycling to fail. This [0-1] recycling failure issue was fixed in PR #47324. 3. The problem addressed by the current PR occurred in the recycler pipeline. The specific phenomenon was that a schema change failed and was aborted, and then the recycler executed the recycling, only to find that the meta was deleted but the rowset object was not. 4. This is because before this PR, if recycle tmp rowset found that the schema of a tablet was missing, it would directly skip recycling the object and only recycle the meta. This method was fine before PR #46798 because recycle tablet would directly delete the tablet folder on the object, and by the time it got to recycle tmp rowset, only recycling the meta was enough. However, after PR #46798, if a tablet only has [0-1] rowsets, and an import fails, then [2-2] will become a tmp rowset. When recycle tablet recycles, it finds only [0-1], so it skips recycling the tablet folder object and only recycles the meta. When recycle tmp rowset, it finds that the tablet schema meta of the tmp rowset is missing, so it thinks [2-2] has been deleted by recycle tablet when it directly deletes the folder, so recycle tmp rowset only deletes the meta. 5. This ultimately led to the deletion of the meta but not the rowset object. ### Solution: This PR modifies the logic of recycle tmp rowset. Regardless of whether the schema meta of the tablet of this rowset exists, it is necessary to recycle the object file of this rowset, which can ensure that all objects can be recycled. In addition, resource IDs will be added to [0-1] during table creation in the future to ensure that recycle tablet can also delete normally. Once [0-1] has a resource ID, both recycle tablet and recycle tmp rowset will delete the object data, providing two layers of protection.
…ed by some bugs (#47475) ### Background: 1. In PR #46798, we modified the way to recycle tablets because if there is a vault that fails to initialize, the original way of recycling tablets would directly return -1 when encountering a failed vault due to not finding an accessor, resulting in an inability to recycle normally. PR #46798 changed this to traverse rowsets and obtain accessors based on resource IDs. Compared to the previous method of directly returning -1 and not recycling anything, this approach can recycle as many rowsets as possible as long as the vault is normal. 2. The aforementioned PR modified the way of recycling tablets. Due to historical reasons, [0-1] rowsetPB does not have a resource ID. Since we assumed that all rowsetPBs have a resource ID, once there is no resource ID, it would return -1, causing the recycling to fail. This [0-1] recycling failure issue was fixed in PR #47324. 3. The problem addressed by the current PR occurred in the recycler pipeline. The specific phenomenon was that a schema change failed and was aborted, and then the recycler executed the recycling, only to find that the meta was deleted but the rowset object was not. 4. This is because before this PR, if recycle tmp rowset found that the schema of a tablet was missing, it would directly skip recycling the object and only recycle the meta. This method was fine before PR #46798 because recycle tablet would directly delete the tablet folder on the object, and by the time it got to recycle tmp rowset, only recycling the meta was enough. However, after PR #46798, if a tablet only has [0-1] rowsets, and an import fails, then [2-2] will become a tmp rowset. When recycle tablet recycles, it finds only [0-1], so it skips recycling the tablet folder object and only recycles the meta. When recycle tmp rowset, it finds that the tablet schema meta of the tmp rowset is missing, so it thinks [2-2] has been deleted by recycle tablet when it directly deletes the folder, so recycle tmp rowset only deletes the meta. 5. This ultimately led to the deletion of the meta but not the rowset object. ### Solution: This PR modifies the logic of recycle tmp rowset. Regardless of whether the schema meta of the tablet of this rowset exists, it is necessary to recycle the object file of this rowset, which can ensure that all objects can be recycled. In addition, resource IDs will be added to [0-1] during table creation in the future to ensure that recycle tablet can also delete normally. Once [0-1] has a resource ID, both recycle tablet and recycle tmp rowset will delete the object data, providing two layers of protection.
…ed by some bugs (apache#47475) ### Background: 1. In PR apache#46798, we modified the way to recycle tablets because if there is a vault that fails to initialize, the original way of recycling tablets would directly return -1 when encountering a failed vault due to not finding an accessor, resulting in an inability to recycle normally. PR apache#46798 changed this to traverse rowsets and obtain accessors based on resource IDs. Compared to the previous method of directly returning -1 and not recycling anything, this approach can recycle as many rowsets as possible as long as the vault is normal. 2. The aforementioned PR modified the way of recycling tablets. Due to historical reasons, [0-1] rowsetPB does not have a resource ID. Since we assumed that all rowsetPBs have a resource ID, once there is no resource ID, it would return -1, causing the recycling to fail. This [0-1] recycling failure issue was fixed in PR apache#47324. 3. The problem addressed by the current PR occurred in the recycler pipeline. The specific phenomenon was that a schema change failed and was aborted, and then the recycler executed the recycling, only to find that the meta was deleted but the rowset object was not. 4. This is because before this PR, if recycle tmp rowset found that the schema of a tablet was missing, it would directly skip recycling the object and only recycle the meta. This method was fine before PR apache#46798 because recycle tablet would directly delete the tablet folder on the object, and by the time it got to recycle tmp rowset, only recycling the meta was enough. However, after PR apache#46798, if a tablet only has [0-1] rowsets, and an import fails, then [2-2] will become a tmp rowset. When recycle tablet recycles, it finds only [0-1], so it skips recycling the tablet folder object and only recycles the meta. When recycle tmp rowset, it finds that the tablet schema meta of the tmp rowset is missing, so it thinks [2-2] has been deleted by recycle tablet when it directly deletes the folder, so recycle tmp rowset only deletes the meta. 5. This ultimately led to the deletion of the meta but not the rowset object. ### Solution: This PR modifies the logic of recycle tmp rowset. Regardless of whether the schema meta of the tablet of this rowset exists, it is necessary to recycle the object file of this rowset, which can ensure that all objects can be recycled. In addition, resource IDs will be added to [0-1] during table creation in the future to ensure that recycle tablet can also delete normally. Once [0-1] has a resource ID, both recycle tablet and recycle tmp rowset will delete the object data, providing two layers of protection.
What problem does this PR solve?
Issue Number:
Related PR: introduced by #47159
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)