Ensure renaming deletes old indexed file
As per gitlab#33255 (closed)
This MR makes 2 changes:
- Minor refactoring to use
put,delinstead ofins,mod,delsincemodwasn't doing anything different toinsand since I think the nameputis a clearer indication of the fact that it will overwrite an existing file unlikeinswhich may make it seem like it will alway create something new - Fixes the bug where renames weren't correctly deleting the old file
It's also worth noting that this will ensure new renames are handled properly there will still be orphaned files from previous renames that won't get cleaned up by this. We may wish to handle that properly too but probably in a separate MR or migration as it's quite tricky. If anyone was really concerned they can always reindex from scratch too.
Edited by 🤖 GitLab Bot 🤖