3 ms·
Exactly, came here to say this. They should delete the line/file/partition if exists, and append/create/format it from scratch every time in order to respect id
by sscarduzio 5y ago
Exactly, came here to say this. They should delete the line/file/partition if exists, and append/create/format it from scratch every time in order to respect idempotency.
Another thing I would recommend is usage of temp directories: you can assume they are empty (easier to reason about). Then do all the work there, an when all operations were successful, you "commit" modified files with "mv/cp -r" and overwrite the real files.
I would call the use of temporary files/folders "transactionality" rather than "idempotency" though.