Conversation
tomusdrw
left a comment
There was a problem hiding this comment.
fs-swap doesn't look atomic. Maybe better randomize the filename witch each run a bit?
|
pr is ready for another review. a) osx is not using APFS (which is the default) in these cases we're trying to do nonatomic swap |
andresilva
left a comment
There was a problem hiding this comment.
The changes in parity look good to me. Regarding fs-swap:
- Linux: you pass
libc::AT_FDCWDtorenameat2shouldn't these be file descriptors to the paths we want to swap?
|
from http://man7.org/linux/man-pages/man2/rename.2.html
If I understand this correctly, by passing |
|
Makes sense, we want to resolve relative paths using the cwd of the process. |
| if existed { | ||
| fs::rename(&backup_db, &self.path)?; | ||
| // ignore errors | ||
| let _ = fs::remove_dir_all(new_db); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
already merged as a part of #8712 |
fs-swapcrate: https://github.com/debris/fs-swap