sapling/eden
Jun Wu 49464342fd indexedlog: try to use symlink for atomic_write on unix
Summary:
The change is in theory not necessary. However it improves the reliability on
OS crashes a bit, and can potentially workaround some bugs in filesystems
(as we saw in production where the atomic-written files are empty and the
system didn't crash).

The idea is, the `symlink` syscall does the file creation and "content" writing
together, while there is no way to create a file and write specific content
in one syscall. Note that the C symlink call uses 0-terminated string, and
the Rust stdlib exports it as accepting `Path`. To be safe, we encode binary
or non-utf8 content using `hex`.

For downgrade safety, the write path does not use symlink by default unless
format.use-symlink-atomic-write is set to true. This makes downgrade possible:
the read path is rolled out first, then we can turn on and off the write path.

The indexedlog Rust unit tests and test-doctor.t are migrated to use the new
symlink code paths.

Reviewed By: DurhamG

Differential Revision: D20153864

fbshipit-source-id: c31bd4287a8d29575180fbcf7227d2b04c4c1252
2020-03-04 07:23:48 -08:00
..
benchmarks enable and fix more warnings 2019-12-20 16:14:17 -08:00
cli use a NullTelemetryLogger during integration tests 2020-03-03 14:56:49 -08:00
docs documentation for paths 2020-01-17 12:08:42 -08:00
fs Record Mercurial tree import time 2020-03-03 11:44:28 -08:00
integration use a NullTelemetryLogger during integration tests 2020-03-03 14:56:49 -08:00
locale add a copyright header to glibc_en.po 2019-04-26 14:38:27 -07:00
mononoke a small tool to backfill git mappings 2020-03-04 06:08:43 -08:00
py update the CLI to handle old EdenFS instances without getDaemonInfo() 2020-03-03 12:15:26 -08:00
scm indexedlog: try to use symlink for atomic_write on unix 2020-03-04 07:23:48 -08:00
scripts Tidy up license headers 2019-10-11 05:28:23 -07:00
test_support eden: remove hypothesis test bits 2020-01-23 11:37:27 -08:00
test-data enable treemanifest in snapshots 2019-08-28 18:46:03 -07:00
third-party fix some macOS build warnings 2020-01-23 17:37:39 -08:00
win flip EDEN_WIN_NOMONONOKE to EDEN_HAVE_MONONOKE 2019-08-27 17:04:19 -07:00
.gitignore eden: wire up mac contbuild 2019-02-05 21:52:30 -08:00
Eden.project.toml Eden.project.toml file for Nuclide 2018-04-26 11:05:23 -07:00