-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Fix](recycler) Delete again to double check when recycle tablet failed by some bugs #47475
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 |
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Hastyshell
left a comment
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.
Related PR: #47475 在pr#47475中,我们修复了潜在的少删数据的问题,是通过在delete rowset data函数中添加删除逻辑,删除recycle tablet中漏删的文件,但是那个pr忽略了其中存在的一个判断条件,导致在recycle tablet中漏删的文件被跳过了,没有实际删除。 在此pr中,tmp rowset不再依赖于上述判断条件,尽可能删除每一个rowset数据,包括倒排索引v2的数据,但是普通的rowset不会跳过这个判断条件,因为普通rowset数量过大,如果不跳过,可能会影响删除效率。
Related PR: apache#47475 在pr#47475中,我们修复了潜在的少删数据的问题,是通过在delete rowset data函数中添加删除逻辑,删除recycle tablet中漏删的文件,但是那个pr忽略了其中存在的一个判断条件,导致在recycle tablet中漏删的文件被跳过了,没有实际删除。 在此pr中,tmp rowset不再依赖于上述判断条件,尽可能删除每一个rowset数据,包括倒排索引v2的数据,但是普通的rowset不会跳过这个判断条件,因为普通rowset数量过大,如果不跳过,可能会影响删除效率。
…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.
Related PR: apache#47475 在pr#47475中,我们修复了潜在的少删数据的问题,是通过在delete rowset data函数中添加删除逻辑,删除recycle tablet中漏删的文件,但是那个pr忽略了其中存在的一个判断条件,导致在recycle tablet中漏删的文件被跳过了,没有实际删除。 在此pr中,tmp rowset不再依赖于上述判断条件,尽可能删除每一个rowset数据,包括倒排索引v2的数据,但是普通的rowset不会跳过这个判断条件,因为普通rowset数量过大,如果不跳过,可能会影响删除效率。
…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.
Related PR: apache#47475 在pr#47475中,我们修复了潜在的少删数据的问题,是通过在delete rowset data函数中添加删除逻辑,删除recycle tablet中漏删的文件,但是那个pr忽略了其中存在的一个判断条件,导致在recycle tablet中漏删的文件被跳过了,没有实际删除。 在此pr中,tmp rowset不再依赖于上述判断条件,尽可能删除每一个rowset数据,包括倒排索引v2的数据,但是普通的rowset不会跳过这个判断条件,因为普通rowset数量过大,如果不跳过,可能会影响删除效率。
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #46798
Problem Summary:
Background:
In PR [fix](recycler) Fix premature exit recycling when there is an invalid storage vault #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 [fix](recycler) Fix premature exit recycling when there is an invalid storage vault #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.
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 [Fix](recycler) Fix recycler fail when dealing with rowset [0-1] #47324.
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.
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 [fix](recycler) Fix premature exit recycling when there is an invalid storage vault #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 [fix](recycler) Fix premature exit recycling when there is an invalid storage vault #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.
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.
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)