Commit Graph

1481 Commits

Author SHA1 Message Date
Chad Austin
3ac3738140 stop prefetching blobs on every open()
Summary:
When a file's contents are not cached by the kernel, open(), read(),
and close() are all piped into the FUSE daemon. But when a file's
contents ARE cached by the kernel, only open() and close() are. Thus,
in the common case, the kernel will notify us that a file is being
opened, but read() will be served out of cache.

In that case, prefetching the blob is not beneficial, because it will
be dropped anyway upon close().

In situations where the VFS cache is hot but eden's own caches are
cold, this is probably a win.

Reviewed By: strager

Differential Revision: D10044546

fbshipit-source-id: eeb0854dbff021b2c73f1a42f31a94dd9fcf0837
2018-09-26 11:39:56 -07:00
Chad Austin
bf8970752d despam periodic unload log and make it useful
Summary:
Previously, Eden would log `UnloadInodeScheduler Unloading Free
Inodes` every 10 minutes. Now it only logs if it actually unloads an
inode for a mount.

Reviewed By: strager

Differential Revision: D9999029

fbshipit-source-id: f01d0e7b1341bef230bcb5a327c31ffc8e3aeb2c
2018-09-25 17:51:41 -07:00
Chad Austin
ecdd694732 add a script to measure minimum and average open() and close() syscall latency
Summary:
We're looking into doing some performance optimizations in Eden to the
open() and close() calls, since they are never handled by the kernel
and always pass through to the underlying user-space FUSE daemon. But
first, let's capture some baseline numbers on Eden and non-Eden
checkouts.

Reviewed By: strager

Differential Revision: D10036941

fbshipit-source-id: 64f3414a4572fd963017491db37d70e6b5ae4f24
2018-09-25 17:36:46 -07:00
Chad Austin
62a2682487 test that inodes can be unloaded while they're loading
Summary:
My eden crashed with an invariant violation in InodeMap. It looks
related to background unloading, so I attempted to reproduce the
sequence in a unit test.

These tests pass but they're worth checking in I think.

Reviewed By: strager

Differential Revision: D9998970

fbshipit-source-id: d182fc8d5b185c286082320adda3ea4c862f2f18
2018-09-25 17:36:46 -07:00
Dan Schatzberg
3e0170774c Move datapack loads to HgBackingStore
Summary:
There's a lot of logic here that need not be offloaded to the
importer threads

Reviewed By: chadaustin

Differential Revision: D9539811

fbshipit-source-id: 1379eef390df6400291a61263d003b493a474b81
2018-09-25 11:21:51 -07:00
Chad Austin
d45636ee81 remove InodeMap::lookupUnloadedInode
Summary: This function is never used.

Reviewed By: strager

Differential Revision: D9998991

fbshipit-source-id: 27a8f5180d7516c3bf61b11192672142f77abccc
2018-09-24 10:39:43 -07:00
Matt Glazar
0cb3add8b0 Remove old workaround in tests
Summary: D6612669 introduced a workaround for edenfs not running as a child of sudo if you run Eden's integration tests as root. D9980225 fixed the underlying bug in 'eden stop' which necessitated the workaround. Remove the now-unnecessary workaround.

Reviewed By: wez

Differential Revision: D9984524

fbshipit-source-id: b9ed7114cd7385a13899d16b4da0d40e6e9fd704
2018-09-21 19:06:16 -07:00
Matt Glazar
0b2bea741d Fix wait_for_shutdown for zombie processes
Summary:
wait_for_shutdown waits for the process to no longer be alive using kill. Unfortunately, kill considers a zombie process (i.e. a process whose parent process hasn't reaped its children) to be alive. Teach wait_for_shutdown to consider zombie processes as dead.

Here's how I discovered this bug:

1. Launch edenfs via 'eden start'
2. Send SIGSTOP to edenfs
3. Call wait_for_shutdown on edenfs

edenfs' parent process (sudo) noticed edenfs' SIGSTOP and sent SIGSTOP to itself. sudo became stuck and never reaped its child edenfs process. Thus, edenfs was a zombie process, and wait_for_shutdown complained.

Reviewed By: chadaustin

Differential Revision: D9980225

fbshipit-source-id: c2663a850225775571b02553ccf9e2d460241b6d
2018-09-21 19:06:16 -07:00
Matt Glazar
f39817488a Add tests for wait_for_shutdown
Summary: I plan on fixing a bug in wait_for_showdown. wait_for_showdown lacks test coverage, so my change could easily break wait_for_showdown. Improve wait_for_showdown's test coverage to prevent bugs.

Reviewed By: chadaustin

Differential Revision: D9980226

fbshipit-source-id: 3f5019a2c5be32b75ca3daa25e799e956c93dab4
2018-09-21 14:52:19 -07:00
Matt Glazar
884791802f Remove unused parameter from wait_for_shutdown
Summary:
wait_for_showdown doesn't use its instance parameter. Delete it.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9980227

fbshipit-source-id: bfc2dd6d84854b20e8c04fc0391edff50d6d0a49
2018-09-21 11:52:26 -07:00
Wez Furlong
de605edbe1 change default entry generation to 0
Summary:
While looking into the ESTALE issue, I was tracing through
the kernel code.  I found that the root inode is set up with a generation
of 0 rather than 1 in this portion of the kernel code:

diffusion/LK/browse/v4.11-fb/fs/fuse/inode.c;abf7d7755299ee009f0c3cba40fcdcd038a212ac$650

The consequences of the generation being different are that the kernel
will report an ESTALE result when returning the dentry:

diffusion/LK/browse/v4.11-fb/fs/fuse/inode.c;abf7d7755299ee009f0c3cba40fcdcd038a212ac$690

This diff zero-initializes the entry result struct and explicitly sets the generation field to 0.

Sadly, this did not impact the manifestation of the ESTALE behavior that I've been running down.

It's also worth noting that the source of the `1` was from reading this comment in libfuse:
0a519c9772/include/fuse_lowlevel.h (L78-L79)
> The generation must be non-zero, otherwise FUSE will treat it as an error.

That isn't true of the kernel component.

Reviewed By: chadaustin

Differential Revision: D9944646

fbshipit-source-id: 9c1e2f4faec40a3aa446a4646d4518a854a1d73c
2018-09-20 12:54:24 -07:00
Wez Furlong
1f9d381451 increase information in some fuse debug statements
Summary: I wanted to see more details from the fuse requests, so log them.

Reviewed By: strager

Differential Revision: D9944649

fbshipit-source-id: 143703528fa029ed51e6cb42a5f6d8b3b0230ca3
2018-09-20 12:54:24 -07:00
Wez Furlong
08323479d6 adopt new thrift streaming API
Summary:
In heap profiles we observed a lot of objects associated
with the journal related to the subscription path.   Those objects
appear to be alive for the duration of the subscription session,
so it gives us good reason to move forwards with updating to the
newer thrift streaming API.

This diff introduces a new endpoint `subscribeStream` that uses
the new RSocket based subscription channel.

Both the Eden server and the watchman client are able to deal
with connections from/to old versions of the server which checks
off the box around push safety.

Once this is widely deployed we can remove `StreamingSubscriber.{cpp|h}`
from the eden code base, and can remove the `legacySubscribe` code
from the watchman code base.

Reviewed By: strager

Differential Revision: D9595967

fbshipit-source-id: 0843e56315f83f1e5fb9bc827b7ee6cf1bf507a6
2018-09-20 12:54:23 -07:00
Yedidya Feldblum
e9e59f8707 Cut assorted dead includes of folly/MoveWrapper.h
Summary: Cut assorted dead `#include`s of `folly/MoveWrapper.h`.

Reviewed By: aary

Differential Revision: D9934365

fbshipit-source-id: f44aa0dd0d8d482e2dc125983929ea8e7fdf974e
2018-09-20 01:54:26 -07:00
Adam Simpkins
ab319c0b25 add a tool for generating snapshots of Eden data
Summary:
This begins adding a framework for generating snapshots of Eden state for use
in tests.  I plan to add a few kinds of tests based on these snapshots:

- Tests that ensure Eden can successfully load snapshots created by older
  versions of the code.

- Tests that corrupt the snapshot data in various ways and then confirm that
  it can be repaired by `eden fsck` and/or still loaded successfully by
  `edenfs` even if it was not repaired with `fsck` first.

This code still needs some additional functionality, but I figured it was
worth checking in what I have so far.  The main functionality that remains to
be added is unpacking the snapshots and updating absolute paths inside the
config files so that they work in the new path where they were unpacked.

Reviewed By: strager

Differential Revision: D9690267

fbshipit-source-id: a2660e49b84d7833e6778108d9abe081ab7e2cbd
2018-09-19 15:07:33 -07:00
Adam Simpkins
8c86c0c8f6 update eden doctor to fix parent commit inconsistencies
Summary:
Update `eden doctor` to automatically fix inconsistencies in Eden and
Mercurial's view of the current parent commit by updating Eden to point to
Mercurial's current p1 commit.

The previous instructions were to use `hg reset --keep` to try and reset
Mercurial's data to point at Eden's parent commit.  However, the most common
case where Eden and Mercurial can get out of sync is after a Mercurial command
has been interrupted, and Mercurial rolled back a transaction without telling
Eden.  In this case the commit that Eden points at does not exist at all, so
trying to use it fails.

Reviewed By: strager

Differential Revision: D9893097

fbshipit-source-id: 3817b83805c7a9959037941204a95ad2bbff2890
2018-09-18 20:36:22 -07:00
Adam Simpkins
15684f2d42 move the _cleanup_tmp_dir() function to integration.lib.util
Summary:
Move the `_cleanup_tmp_dir()` function out of the integration lib's testcase
module, and make it a public function in the integration lib util module.

This will make it easier to re-use from some other python utilities that need
to be able to clean up Eden state directories.

Reviewed By: strager

Differential Revision: D9690266

fbshipit-source-id: 157c5221f81f90a3e9612315681459d16693cdbc
2018-09-18 19:53:23 -07:00
Adam Simpkins
21665a1597 disable hg telemetry logging in Eden tests
Summary:
Update the Eden unit tests and integration tests to set the `NOSCMLOG`
environment variable when running `hg` commands.  This ensures that our
mercurial telemetry wrapper does not log events from Eden test runs.

Reviewed By: quark-zju, strager

Differential Revision: D9893096

fbshipit-source-id: c0dd4b5eb042dcb5e9493c89aaee10a513022bae
2018-09-18 12:08:55 -07:00
Matt Glazar
edbb3838ba Fix crash during inode scan
Summary:
If the overlay file for a directory is corrupted (e.g. empty), Overlay::scanForNextInodeNumber throws. This causes Eden to crash on start [1]. Fix the crash by ignoring corrupted directories.

[1] `test_mount_possible_after_corrupt_directory_and_cached_next_inode_number` reproduces this crash.

Reviewed By: chadaustin

Differential Revision: D9806105

fbshipit-source-id: 1b95083b6a6aa253a2296d6f754edbf4b9f64734
2018-09-17 14:23:53 -07:00
Mark Thomas
173e58e9de add txnutil.mayhavesharedpending override
Summary: Override `txnutil.mayhavesharedpending` in the same way as `txnutil.mayhavepending`.

Reviewed By: strager

Differential Revision: D9834375

fbshipit-source-id: 7cd9d35121957343e8b15728485457072de047b5
2018-09-15 03:22:23 -07:00
Lee Howes
e8e25257cf Future<T>::then Future<T>::then() -> Future<T>::thenValue or thenTry.
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).
  future<T>.then(callable with operator()(folly::Try<T>)) to future<T>.thenTry(callable)

Reviewed By: Orvid

Differential Revision: D9819578

fbshipit-source-id: f9e31f47354c041ecbf0a90953cbe50ebfda6adc
2018-09-14 17:10:57 -07:00
Matt Glazar
b3a7d80c03 Print inode tree on overlay test failure
Summary: When a RawOverlayTest test fails, it's sometimes difficult to diagnose the failure because assertions use inode numbers instead of file paths. When a test fails, include inode data (with file paths) in the failure message.

Reviewed By: chadaustin

Differential Revision: D9806106

fbshipit-source-id: 6160632bf8c64ceeb84e9d4709347e9268747ca4
2018-09-13 14:55:03 -07:00
Chad Austin
b861392284 Fix eden debug unload . from the root of the checkout
Summary:
The C++ code disallows use of "." in RelativePaths, but it's
reasonable for users of the Thrift API to pass "." to indicate the
root of the mount. Handle that in the EdenServiceHandler.

Reviewed By: strager

Differential Revision: D9647776

fbshipit-source-id: b61c2d1c0dcd69ccfa38bf27379281d10cdf1ceb
2018-09-13 14:55:03 -07:00
Matt Glazar
57ec146629 Refactor setup code in RawOverlayTest
Summary:
Reduce some code duplication in RawOverlayTest:

* Factor testDir_-to-AbsolutePath conversion into a getLocalDir function.
* Factor Overlay construction into a loadOverlay function.
* Use getLocalDir to construct the path to next-inode-number.

This refactor will let me use getLocalDir for more things in future diffs.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9813443

fbshipit-source-id: ab0dc88d36e91fc04e0aeb48468060b93b48f0ec
2018-09-13 14:24:14 -07:00
Matt Glazar
cbcb6eafca Delete stale comment
Summary:
Eden keeps track of the the highest-allocated inode number using the next-inode-number file. The TODO comment in Overlay::scanForNextInodeNumber is thus out of date. Delete the outdated comment since the feature has already been implemented.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D9806107

fbshipit-source-id: f546eb179b86a11a6c4bf0d5f945dc7dbbf29160
2018-09-13 13:23:43 -07:00
Chad Austin
d986fed38c always unload trees prior to checkout
Summary:
The checkout operation is a bit hamstrung, performance-wise, when
inodes are loaded. If it's possible the kernel has a reference to an
inode, we can't short-circuit the checkout operation and instead must
precisely add and remove children from the source control tree and
persist the new children and inode numbers into the overlay.

It's much faster if we treat checkout as an inode-number-invalidating
change and unload all inodes that aren't referenced by the kernel.

Reviewed By: strager

Differential Revision: D9781532

fbshipit-source-id: 50912cf89dbe9ae1bd7ef91fdf7bf8ee5eda8667
2018-09-12 14:37:25 -07:00
Chad Austin
5567363018 add a function that only unloads children unreferenced by FUSE
Summary: Add yet another unloading code path... This one is used for fast checkouts.

Reviewed By: strager

Differential Revision: D9781956

fbshipit-source-id: ae89377aea823f94e2ec1bcc2fa209c8f9bc821c
2018-09-12 14:37:25 -07:00
Chad Austin
5070d76451 fix TreeInode::unloadChildrenNow so it unloads trees
Summary:
unloadChildrenNow would only unload files or trees at the leaf. Apply
the fixes from D8302998 to unloadChildrenNow, which is only called
during takeover.

Reviewed By: strager

Differential Revision: D9774970

fbshipit-source-id: c2f4d1e6b838cc3b9e99eb8786114e643128a519
2018-09-12 14:37:24 -07:00
Matt Glazar
aa3beac504 Work around LSAN reports for hg_importer_helper
Summary: LSAN detects leaks for Python's and Hg's code. When running Eden's tests, whenever hg_importer_helper exits, LSAN prints lengthy leak reports. (Eden ignores hg_importer_helper's exit code, so LSAN's reports don't cause tests to fail.) Fix the log spam by disabling LSAN for hg_importer_helper.

Reviewed By: wez

Differential Revision: D9756053

fbshipit-source-id: 457404c46e1c81f52c2ad754ab67fd180d26935c
2018-09-11 11:36:21 -07:00
Wez Furlong
d191495cac allow mononoke to be used with www
Summary: This hardcoded list is blocking using eden + mononoke with wwww

Reviewed By: chadaustin

Differential Revision: D9762557

fbshipit-source-id: 40991b26b702aa87a86a66934a069995d70f9f34
2018-09-11 10:54:58 -07:00
Chad Austin
29548a00c5 add top pids to eden top output
Summary:
To diagnose why a process is hitting Eden so hard, show the top pids
in eden top's output too.

Reviewed By: strager

Differential Revision: D9486293

fbshipit-source-id: 0714c354cafef4dae60b2615d20f7e940e24daf0
2018-09-10 13:52:52 -07:00
Chad Austin
9a2c376eec add eden top command
Summary:
Add a curses-based `eden top` command that displays the top process
names currently accessing an Eden mount over FUSE.

In the future, I'd like to extend this to count and record Thrift
calls too.

Reviewed By: strager

Differential Revision: D9477936

fbshipit-source-id: f878f2e67f4ea24c036880eb4b1162597dc04185
2018-09-10 13:52:52 -07:00
Chad Austin
e750ab68fe expose FUSE accesses over Thrift
Summary:
Add a Thrift API for reading the pid access logs from each
EdenMount/FuseChannel. Used in a future diff.

Reviewed By: strager

Differential Revision: D9477867

fbshipit-source-id: 0897a915ca654bca952aecc123ea40105830a75b
2018-09-10 13:52:51 -07:00
Chad Austin
e88177a2f3 count FUSE accesses by process ID
Summary: Begin tracking pids passed into FUSE in the ProcessAccessLog.

Reviewed By: strager

Differential Revision: D9595795

fbshipit-source-id: 02e5fefebcd0de860274409ba6258f14fa050b55
2018-09-10 13:52:51 -07:00
Lee Howes
f28ef8281c [] Future<T>::then Future<T>::then(not-try-task) -> Future<T>::thenValue(task). - 2/11
Summary:
Part of the larger project to modify Future<T>::then to be r-value qualified and use Future<T>::thenTry or Future<T>::thenValue.

The goal is to disambiguate folly::Future and to improve type and lifetime safety of Future and its methods.

Codemod:
  future<T>.then(callable with operator()(not-a-try)) to future<T>.thenValue(callable with operator()(not-a-try)).
  future<T>.then(callable with operator()()) to future<T>.thenValue(callable with operator()(auto&&)).
  future<T>.then(callable with operator()(auto)) to future<T>.thenValue(callable with operator()(auto)).

Reviewed By: Orvid

Differential Revision: D9696716

fbshipit-source-id: d71433c75af8422b2f16733c0b18a417d5a4cf2e
2018-09-07 11:07:25 -07:00
Matt Glazar
bdf73e42de Fix broken build
Summary:
It looks like D9477181 conflicted with D9635507, causing a compile error:

```
eden/fs/utils/ProcessNameCache.cpp:74:15: error: no member named 'names' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        state.names.emplace(pid, ProcessName{detail::readPidName(pid), now});
        ~~~~~ ^
eden/fs/utils/Synchronized.h:48:10: note: in instantiation of function template specialization 'facebook::eden::ProcessNameCache::add(pid_t)::(anonymous class)::operator()<folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive> >' requested here
  return update(wlock);
         ^
eden/fs/utils/ProcessNameCache.cpp:58:3: note: in instantiation of function template specialization 'facebook::eden::tryRlockCheckBeforeUpdate<folly::Unit, facebook::eden::ProcessNameCache::State, (lambda), (lambda)>' requested here
  tryRlockCheckBeforeUpdate<folly::Unit>(
  ^
eden/fs/utils/ProcessNameCache.cpp:81:15: error: no member named 'waterLevel' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        state.waterLevel += 2;
        ~~~~~ ^
eden/fs/utils/ProcessNameCache.cpp:82:19: error: no member named 'waterLevel' in 'folly::LockedPtr<folly::Synchronized<facebook::eden::ProcessNameCache::State, folly::SharedMutexImpl<false> >, folly::LockPolicyExclusive>'
        if (state.waterLevel > state.names.size()) {
            ~~~~~ ^
3 errors generated.
```

Dereference `state` to fix the error.

Reviewed By: chadaustin

Differential Revision: D9673324

fbshipit-source-id: 5143cd22baf66307e5aacb0a04669de69dde99e8
2018-09-05 21:23:16 -07:00
Chad Austin
b55e4dbb58 introduce a ProcessAccessLog
Summary:
Add a ProcessAccessLog that supports cheaply tracking pids passed
into FUSE. It's a write-many, read-maybe access pattern, so the code
is careful to add as little latency as possible on the hot path.

Reviewed By: strager

Differential Revision: D9477839

fbshipit-source-id: 6928c1d09d55c2b0c0958ac2cb0dc91ec21b370c
2018-09-05 15:06:58 -07:00
Chad Austin
0cc3121417 Minor FuseChannel optimizations
Summary: While looking at FuseChannel I noticed an unnecessary Future.

Reviewed By: strager

Differential Revision: D9595672

fbshipit-source-id: 5c84822c4f2c4c3c78b88456e44728e463d5a1e8
2018-09-05 15:06:58 -07:00
Chad Austin
7bc8e0cbe0 add a ProcessNameCache
Summary:
Eden is accessed by many short-lived processes. We want to show their
names in `eden top` so efficiently try to grab the names of pids. This
code will be used in a later diff.

Reviewed By: strager

Differential Revision: D9477181

fbshipit-source-id: 28998ac8bf7b804a3bd4944fbda4c7d1a0918312
2018-09-05 15:06:57 -07:00
Chad Austin
ff5ea60cdb Add a BucketedLog for recording pid accesses by second
Summary:
For `eden top`, we want to count accesses by pid by the second for the
past N seconds. Remembering forever would be too expensive so add a
circular data structure that forgets old entries on insertion and
reads.

Reviewed By: strager

Differential Revision: D9477166

fbshipit-source-id: 7019d441fde0cf40d8f5b08ed8dc13fafe0cbcac
2018-09-05 15:06:57 -07:00
Dan Schatzberg
bf5055b47e Make TreeInode::getOrLoadChild use tryRlockCheckBeforeUpdate
Summary:
This method is called on every lookup and getSha1 (anything
that seeks a path) and can be a pretty contended lock, so let's make
it optimistically attempt a read lock.

Reviewed By: chadaustin

Differential Revision: D9635505

fbshipit-source-id: c84751efb7a952b2cf458e06ffc8ee670638f9bb
2018-09-05 07:53:57 -07:00
Dan Schatzberg
947a423e72 Make tryRlockCheckBeforeUpdate return an rref
Summary:
Without this, you cannot use this method for non-copyable
types (e.g. Future)

Reviewed By: chadaustin

Differential Revision: D9635506

fbshipit-source-id: e57f1ae79acd544e5db0557d4654b675a419304c
2018-09-05 07:53:57 -07:00
Dan Schatzberg
e80a31de94 Have tryRlockCheckBeforeUpdate pass a LockedPtr
Summary:
By passing a locked ptr instead of a reference directly to
the locked object, the check and update methods can drop the lock
early

Reviewed By: chadaustin

Differential Revision: D9635507

fbshipit-source-id: a881043cfd2c28f6f53eb12e1494fcbc5f7f8e08
2018-09-05 07:53:57 -07:00
Chad Austin
d4d3102892 enable the periodic inode unload job
Summary:
Every 10 minutes, unload any inodes that have not been accessed within
6 hours.  This work helps keep Eden's memory usage from growing to O(repo) over
time.

Reviewed By: wez

Differential Revision: D6766900

fbshipit-source-id: af4af8fe12e5f43ce90f26578fa9bd534f124085
2018-09-04 12:23:19 -07:00
Puneet Kaushik
5a7df37497 win: Fixing build scripts to setup contbuild in lego-win
Summary:
Modified the build scripts to use dependencies from D:\edenwin64. This is the location where we will mount the edenwin64.iso.

It also contains changes to compile it with the latest Eden Linux changes plus removed some POC stuff and dependencies from my laptop.

Reviewed By: strager

Differential Revision: D9545688

fbshipit-source-id: e92e34d0af07974845faf9f729e0861fde5af459
2018-09-02 14:21:56 -07:00
Adam Simpkins
95c4f2e72b fsck: report all orphan inodes as single error
Summary:
Change how fsck reports orphan inodes so that it only creates a single Error
object tracking all orphan inodes.

This will make it easier to write code to fix the orphan inodes as we will
want to process all of the orphan inodes together.

Reviewed By: wez

Differential Revision: D9615337

fbshipit-source-id: 452d0e67f357b8b2ac3b24d89e23fffb5bd816fd
2018-08-31 19:06:25 -07:00
Adam Simpkins
f15751255c improve some of the fsck output
Summary:
Wait to print errors until after we have finished scanning all of the overlay
files.  Previously we printed errors as they were detected.  However we would
not be able to print the path names correctly if we had not processed all of
the inode's parents yet.  This resulted in error messages incorrectly
displaying paths as unlinked in some cases.

Also improve the error strings shown for MissingMaterializedInode and
InvalidMaterializedInode to also include the inode number.  Also correct the
inode type display for InvalidMaterializedInode.

Reviewed By: wez

Differential Revision: D9615336

fbshipit-source-id: eb273d51c937e76ffed0e021da848f5fb940145d
2018-08-31 19:06:25 -07:00
Adam Simpkins
d78bdef25c add an --overlay flag to the fsck command
Summary:
Add an --overlay flag to the `eden fsck` command to allow running it on an
alternative overlay directory.

This is similar to the `--overlay` flag added to the `eden debug overlay`
command in D9445560.

At the moment a checkout path is still required when running
with `--overlay`.  This is used to find the socket to talk to edenfs.  This is
not actually used at the moment, but in the future we may need this in order
to help fix some of the filesystem state in some cases.  (For instance to get
the current blob or tree ID for a path in the current commit.)

Reviewed By: wez

Differential Revision: D9615334

fbshipit-source-id: 5a0da55f00429f596be5d86e5303e1fcdeff9ea7
2018-08-31 19:06:25 -07:00
Wez Furlong
35b902fdc2 fix toml config parsing issue with booleans
Summary:
Unfortunately, our current config parsing implementation is
forcing us to stringly-type all data, which partially defeats one
of the benefits of using a modern typed configuration file format
such as TOML.

This means that boolean options have to be specified as strings in
the config file.

I don't want to ship the Mononoke feature integration out and tell
folks to use `"true"` to turn it on as it will impose a future migration
concern on us.

This diff does the simple but gross thing: at parse time, rather than
ignoring boolean values, we convert them to string so that the upper
layer can convert them to bools again.

Reviewed By: strager

Differential Revision: D9582582

fbshipit-source-id: a8eb8a8e4b59e3d74b3371b743a6eb590b3b0f58
2018-08-31 13:07:52 -07:00
Chad Austin
262aff7bda Have eden debug unload unload trees too
Summary:
Rewrite the unload code to avoid UB (comparing freed InodeBase
pointers) and unload tree inodes too.

Reviewed By: simpkins

Differential Revision: D8302998

fbshipit-source-id: c3c3b1a65209735056fbc66216e4f01eafd65492
2018-08-31 11:22:30 -07:00