Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return remove dir error of table dirStats to trigger retry. (#4134)
The current issue is that when there's an error in deleting dirstats, the rmdir operation still proceeds (the transaction is successfully committed). However, the next time a mkdir operation with the same name is attempted, it will check dirstats. If it already exists, an error is reported, making it impossible to make a directory with the same name. There are two options to fix this issue: 1) Return the rmdir error. This will trigger a retry to execute rmdir later. 2) Ignore existing dirstats during mkdir. For option2, I think it requires the logic to check if the dirStats table is the only one not removed by the previous transaction, if so, overwrite the old one during mkdir, if not, report EEXIST error. This requires far more changes than option1, so option1 is preferred here.
- Loading branch information