Commit Graph

1850 Commits

Author SHA1 Message Date
Puneet Kaushik
b01d4a721d Implemented check file name functionality to workaround a Projected FS issue.
Summary:
There is a bug in Projected FS on Windows 1903 and 1909, which BSODs the system on SetInformation call. Projected FS seems to be dereferencing a nullptr while attempting to check if the file is in the backing store. Providing a separate callback to check if the file exists in the backing store will avoid the buggy code (suggested by Microsoft).

This will enable Eden FS on Windows 1903 and 1909.

Reviewed By: simpkins

Differential Revision: D19377522

fbshipit-source-id: ab5e9bc8e2472f3e689d71d05a560bac86211295
2020-01-13 16:15:09 -08:00
Puneet Kaushik
8899c53892 Update Windows EdenMount::getRootTree return a future
Summary: This is a followup on D18666585.

Reviewed By: chadaustin

Differential Revision: D19377523

fbshipit-source-id: f9ab4011d0978a6934de77d1837a37082603cf52
2020-01-13 16:15:09 -08:00
Puneet Kaushik
1350e4f8ce Fixing ObjectStore::create signature in Windows TestMount
Summary: We missed updating this in D18669664.

Reviewed By: simpkins

Differential Revision: D19377524

fbshipit-source-id: e23fb039047855454b4f12353bc375b1a2c8d962
2020-01-13 16:15:08 -08:00
Eric Niebler
a338113719 Remove folly's ColdClass, which was of dubious utility
Summary: `folly::cold_detail::ColdClass` was marking things (like `folly::Unexpected`) cold, but at the cost of inhibiting the inliner from doing its job. This is leading to bad codegen, which offsets any small wins we mind get for the `cold` attribute.

Reviewed By: yfeldblum

Differential Revision: D19324159

fbshipit-source-id: 7ed431b6c9d6e963c3bf438c707fa6cf6a38bf9d
2020-01-09 13:09:56 -08:00
Chad Austin
bf4441ee86 use unicode micro symbol when logging thrift call durations
Summary: µ

Reviewed By: wez

Differential Revision: D19191188

fbshipit-source-id: 287d208808d782179ce9e70c323f8dd45e5168c3
2020-01-08 14:43:25 -08:00
Chad Austin
91eda6e3e3 fix cmake build
Summary:
D19135344 broke EdenFS's cmake builds, and our macOS releases haven't
been going out. Rather than pass the same streaming options to the
Thrift compiler in the CMake build, remove deprecated_server_streams
from both builds.

Reviewed By: simpkins

Differential Revision: D19204397

fbshipit-source-id: c22e634ded82a683daff5c92182c8a1eb1ed4d21
2020-01-08 14:08:34 -08:00
Jon Maltiel Swenson
cc1a7ddcde Kill rsocket server stack
Summary: This stack is deprecated in favor of the rocket stack.

Reviewed By: rhodo

Differential Revision: D18123600

fbshipit-source-id: db6e3bf4add9c49cf8f1d2f12f97b207e87c7302
2020-01-03 15:53:10 -08:00
Adam Simpkins
80b8e1bfd2 drop the log level for some debug messages
Summary:
Reduce the log level for a few messages to help reduce some less important
clutter when running with an elevated debug log level.

Reviewed By: chadaustin

Differential Revision: D19188773

fbshipit-source-id: 396bb15e119fc12765ecbc707e7a1dadbdd02422
2019-12-20 16:14:23 -08:00
Chad Austin
3d3c2a9f32 stop storing sizes in their own local store column
Summary:
Remove some half-baked, unnecessary logic for caching sizes separately
from SHA-1. Eden's backing stores do not support chunking large files
yet, so there's no value in caching content SHA-1 and size
separately. This fixes a scenario where fetching blob size and then
SHA-1 would result in two backing store imports.

Reviewed By: fanzeyi

Differential Revision: D19169096

fbshipit-source-id: dc32f3313e5f4230c06a5bbaa67da7bf0febaba8
2019-12-20 16:14:23 -08:00
Chad Austin
873fd0de43 enable tree caching in non-hg backends
Summary:
Troditionally, ObjectStore relied on HgBackingStore writing directly
to LocalStore in order to cache trees. This had the unfortunate side
effect that other backing store implementations did not benefit from
tree caching.

Move tree caching into ObjectStore so all backing stores benefit from
tree caching.

Reviewed By: simpkins, fanzeyi

Differential Revision: D19168211

fbshipit-source-id: b1019591ebb4760cc8b933b9adb82174b8e5fa1f
2019-12-20 16:14:23 -08:00
Chad Austin
0d67cc3833 fix tree import when local store loses its cache
Summary:
If a GC ran at the same time as HgBackingStore imported a commit, the
import would fail. Rather than round-tripping the tree through the
LocalStore, just return it.

Reviewed By: genevievehelsel

Differential Revision: D19167798

fbshipit-source-id: eddb280def349483289d2e300a58eff3ad7416e1
2019-12-20 16:14:22 -08:00
Genevieve Helsel
f6cfa5f229 remove use of getScmStatusBetweenRevisions in eden doctor
Summary: There is one instace of `getScmStatusBetweenRevisions` in use - it is used in the eden cli in a hacky way to check if a commit hash is valid. Since this is not used anywhere else in a meaningful way, this replaces that use case with a hg call and depreciates `getScmStatusBetweenRevisions`

Reviewed By: simpkins

Differential Revision: D18690026

fbshipit-source-id: 02bd2c20a0f631ec41116f9fd4e18d14369298ef
2019-12-20 16:14:22 -08:00
Zeyi (Rice) Fan
071a3682fd eden: semi-futurify BackingStore::getTree
Summary: D18669664

Reviewed By: chadaustin

Differential Revision: D18670157

fbshipit-source-id: 74c8c3e2fae16973079e5d3d3bc2fe18adf088a7
2019-12-20 16:14:22 -08:00
Zeyi (Rice) Fan
99c2a6ca2e eden: semi-futurify BackingStore::getTreeForCommit
Summary: Same as D18669664.

Reviewed By: chadaustin

Differential Revision: D18669966

fbshipit-source-id: 54974528259a91f8f222bd60e897d28f41675351
2019-12-20 16:14:22 -08:00
Zeyi (Rice) Fan
aeaa26c274 eden: semi-futurify BackingStore::getTreeForManifest
Summary: see D19107687

Reviewed By: genevievehelsel

Differential Revision: D19107687

fbshipit-source-id: 652084ad0e64884d6273a4206d26d572915e3a51
2019-12-20 16:14:22 -08:00
Zeyi (Rice) Fan
068ff196bd eden: SemiFuture-ify BackingStore::getBlob
Summary:
This diff turns the return type of `BackingStore::getBlob` from `folly::Future` into `folly::SemiFuture` to prevent executor leaks.

This also enable us to remove the need of holding `serverThreadPool` from backing stores.

----

**Changes**

* `ObjectStore` now needs to hold a `folly::Executor::KeepAlive` that is used to turn `SemiFuture`s it gets from backing stores into `Future`.
* Signature changes of the implementations of `BackingStore` class.
* For tests, I chose to use `QueuedImmediateExecutor` in place of `UnboundedQueueExecutor` as it will basically execute tasks inline. I'm concerned introducing thread pool executor in tests may turn tests flaky.

Reviewed By: wez

Differential Revision: D18669664

fbshipit-source-id: 0cae89f365dcf8b345b49d64469a530cf25d4ac5
2019-12-20 16:14:21 -08:00
Adam Simpkins
983f454135 limit the number of tree prefetch operations that can run in parallel
Summary:
Add a config option to restrict the number of tree prefetches that can run in
parallel.  Without this applications that recursively walk a checkout tree can
end up spawning a huge number of asynchronous prefetch operations.  These
prefetch operations are quite expensive today, as we currently have to fetch
the full file contents in order to retrieve the file sizes.  A recursive
directory walk can end up building up a huge backlog of in-progress tree
prefetches.  This will slow down the directory walk, and it can take tens of
minutes to finish processing the prefetch backlog even after the directory
walk is aborted.

Reviewed By: chadaustin

Differential Revision: D19136685

fbshipit-source-id: cdc7a570d016fd7ca81a639cef83380b197acdfc
2019-12-20 16:14:19 -08:00
Chad Austin
a5cbdfeb1d remove the dead getChildByName function
Summary: #deadcode

Reviewed By: genevievehelsel

Differential Revision: D18822498

fbshipit-source-id: fd2dc63139758121c27a877e37c8e1aaf7f9c9b5
2019-12-20 16:14:18 -08:00
Chad Austin
844b569d2a make EdenMount::getRootTree return a future
Summary:
EdenMount offered both getRootTree and getRootTreeFuture. Replace the
former with the latter and adjust remaining callers.

Reviewed By: genevievehelsel

Differential Revision: D18666585

fbshipit-source-id: 961361a1fb545e48db0ece970bb5e6ffbca8efef
2019-12-20 16:14:18 -08:00
Chad Austin
b75b10bc33 kill ObjectStore::getBlobMetadata
Summary:
The last remaining user of ObjectStore::getBlobMetadata was a debug
Thrift call. Remove it and update the Thrift call to use getBlobSize
and getBlobSha1.

Reviewed By: pkaush

Differential Revision: D18663376

fbshipit-source-id: 86baefc9004a07aac4ddf5849870431be04c75f2
2019-12-20 16:14:18 -08:00
Chad Austin
e092f4ef1a fix warnings in the macOS build
Summary: Fix some warnings that only show up in the macOS build.

Reviewed By: fanzeyi

Differential Revision: D19053236

fbshipit-source-id: 81f7187b263e0db6a57582677088519f9b97f1d7
2019-12-20 16:14:17 -08:00
Chad Austin
11589b3595 enable and fix more warnings
Summary: Enable a couple nice-to-have warnings.

Reviewed By: simpkins

Differential Revision: D18800030

fbshipit-source-id: 5bca073c6dd0b2d40ba8c2c9725fe152f20042a5
2019-12-20 16:14:17 -08:00
Adam Simpkins
d0ba23f47a decrease the log level of globFiles() thrift calls
Summary:
D18820280 increased the log level for `globFiles()` calls from DBG3 to DBG2.
However, buck and other tools often end up huge numbers of glob calls, and
this ends up causing log spam.

This change reduces the log level of `globFiles()` back to DBG3.  In a
subsequent diff I will update the code to increase the log level for slow
calls.  This does mean that we will only get a log message for slow glob calls
after the call completes, but this is better than not getting a message at
all.

Reviewed By: pkaush

Differential Revision: D18924780

fbshipit-source-id: 86e83614f51424aca078e4de8a56c45018a6d286
2019-12-10 20:18:36 -08:00
Genevieve Helsel
8ff8d6217e setParentCommits after checkout while holding parentsLock_
Summary: was looking in this area and saw this TODO. moves the `setParentCommits()` call into `CheckoutConflict::finish()` so it is called while we are still holding the parents lock.

Reviewed By: chadaustin

Differential Revision: D18668329

fbshipit-source-id: 8415c792193e5b89737f15141f33c5a9799f527b
2019-12-10 18:13:26 -08:00
Chad Austin
d0ce25afba log to scuba upon automatic gc
Summary:
A spike in automatic GCs usually implies something has gone wrong. Log
an event for each one, recording the cache size prior to the GC and
the cache size after.

Reviewed By: simpkins

Differential Revision: D18902580

fbshipit-source-id: 158b2635733a415a9fcc7c412b2c0f44ed04aa01
2019-12-10 16:16:35 -08:00
Puneet Kaushik
eb17a5bde8 Enable getScmStatusBetweenRevisions
Summary: Enabling getScmStatusBetweenRevisions to work on Windows and its tests.

Reviewed By: simpkins

Differential Revision: D18431271

fbshipit-source-id: eee82538e2fc3d7e371c96fc271cd9662ea6d737
2019-12-10 14:07:26 -08:00
Puneet Kaushik
4c720d12c1 hg status tests for Eden Windows
Summary: This diff contains the tests for hg status. This is not comprehensive list of tests but the tests that we have working at this time. More tests will be added as we test and fix issues.

Reviewed By: simpkins

Differential Revision: D18454851

fbshipit-source-id: 80e3ff4d24873016dc420f202fbfe53fcffc24f2
2019-12-10 14:07:26 -08:00
Puneet Kaushik
8b0feed6fd Move EdenDispatcher under PrjfsChannel
Summary: The current implementation of EdenDispatcher is projectedfs specific and was linking against its dll. This was adding the need to add Prjfs dll for running our tests. Moving it to prjfs channel should fix that.

Reviewed By: simpkins

Differential Revision: D18462171

fbshipit-source-id: ff7bfcdd14d19552d49b61ff03cdd770badfcd68
2019-12-10 14:07:26 -08:00
Puneet Kaushik
35accc34bc Add TestMount class to test EdenMount
Summary: This class provides an interface to create an EdenMount for testing and use it through the APIs. It's similar to TestMount for Eden on Posix.

Reviewed By: simpkins

Differential Revision: D18454852

fbshipit-source-id: 91d64b2c535060979ef634fe4e7779f50f169fc5
2019-12-10 14:07:25 -08:00
Puneet Kaushik
f54831e526 Teach WinStore to work with std::wstring_view to avoid unnecessary copy
Summary: WinStore interface was taking wstring for path and we were converting wchar pointers to wstring which were later converted to RelativePath. In this diff we pass the path as is and save one copy per operation.

Reviewed By: simpkins

Differential Revision: D18444773

fbshipit-source-id: fa6a3efb6a7e91cf9b0dca919e80870e1bcf0804
2019-12-10 14:07:25 -08:00
Puneet Kaushik
abfdda5447 Create TestFsChannel class
Summary: Moved the current FsChannel implementation in to PrjfsChannel and converted the FsChannel.h into an abstract class. Created a TestFsChannel class for testing.

Reviewed By: simpkins

Differential Revision: D18440401

fbshipit-source-id: 30d6742cd18b4b76b664e3af7ed1a528cf876046
2019-12-10 14:07:25 -08:00
Puneet Kaushik
e19f84aa65 Add resetParents to enable hg commit
Summary:
A successful run of hg commit ends in call to resetParents() to reset the current parent commit.

We also need resetParent to run the Status tests.

Reviewed By: genevievehelsel

Differential Revision: D18439954

fbshipit-source-id: 44f7a009e050bd5e2130d8c4fc3a85a8ec3bfad1
2019-12-10 14:07:24 -08:00
Puneet Kaushik
86f5c839d1 Add EdenMount diff to generate the ScmStatus
Summary: This implements diff() inside EdenMount which uses GenerateStatus to compute the ScmStatus.

Reviewed By: simpkins

Differential Revision: D18195574

fbshipit-source-id: 16cfbda35796d1cfd4e13e6566b7ac222163aea4
2019-12-10 14:07:24 -08:00
Puneet Kaushik
7e2de5609a Add GenerateStatus to compute the status change
Summary:
GenerateStatus will parse the CurrentState and compute the status. The algorithm here is little different than of Eden with FUSE, Eden with Prjfs will loop over the CurrentState and only compare the entries present in it. CurrentState has the list of all the entries modified and a complete status could be generated from it.

This doesn't solve all the scenarios. I have few unit tests running at the top of this stack and those cases are working. I need to test the other cases and make them work. One case that I already know doesn't work is when a user resets the parent and doesn't make any change. I will work on fixing the other cases and put up diffs for that.

Reviewed By: simpkins

Differential Revision: D18195573

fbshipit-source-id: 3650f26387f1a5f8d467fd81148c266fa1307a3c
2019-12-10 14:07:24 -08:00
Zeyi (Rice) Fan
ae1dae6b96 eden: add experimental:use-edenapi for optionally turn on EdenApi importing
Summary:
Add an option `experimental:use-edenapi` to `EdenConfig`.

See the next diff for usage.

Reviewed By: chadaustin

Differential Revision: D18605549

fbshipit-source-id: 2786c21bb38a76229078662cc5c1ddf906d1be4a
2019-12-10 13:40:55 -08:00
Zeyi (Rice) Fan
ed9e7abca2 eden: add FakeEdenConfig for testing
Summary:
I think we need to make `EdenConfig` available for testing as more things are using `EdenConfig` to configure behaviors.

Right now it does not do much things other than just construct an `EdenConfig` instance without manually providing these parameters.

Reviewed By: chadaustin

Differential Revision: D18798484

fbshipit-source-id: b4a85d966a9b4f425c547bef9eb6e7570d7e2170
2019-12-10 13:40:55 -08:00
Chad Austin
b47bf0289e ensure fuse capability flags survive graceful restart
Summary:
Two bugs conspired to cause edenfs after a graceful restart to think
the kernel supported FUSE_NO_OPENDIR_SUPPORT when it didn't: the
connection info struct wasn't zeroed, and FUSE connection capabilities
weren't properly mirrored into the Dispatcher upon graceful
restart. Fix both and add an integration test.

Reviewed By: simpkins

Differential Revision: D18903761

fbshipit-source-id: 23f4db3e240ee7d035f707820072c606a45f1138
2019-12-10 10:25:30 -08:00
Chad Austin
40e6e4bde2 enable eden debug logging in open source and macOS builds
Summary:
Register the logging and logging_full option handlers in the open
source and macOS builds of Eden.

Reviewed By: simpkins

Differential Revision: D18870545

fbshipit-source-id: 140debe77be071a9fa2d628ad305517273e095e3
2019-12-09 19:41:18 -08:00
Genevieve Helsel
504a255355 add getTreeForManifest
Summary: Adds a function which takes both the manifestID and the commitID to get a Tree. This will be used in `checkOutRevision()` and this allows us to skip looking up the manifestID since the caller can just pass it in themselves.

Reviewed By: wez

Differential Revision: D18719405

fbshipit-source-id: 919f0a7c84bff4a2f0bc20110c45bd272f9e9107
2019-12-09 16:25:27 -08:00
Chad Austin
4963352d64 temporarily mark trees persistent
Summary:
It is very painful for Eden's automatic GC to delete trees from the
local store. An unfortunate number of programs scan the entire repo,
causing every tree to be loaded. If Eden's automatic GC kicks in, it
causes all trees to be downloaded again, blocking both FUSE and Thrift
requests.

Temporarily mark trees as persistent.

Reviewed By: fanzeyi

Differential Revision: D18842066

fbshipit-source-id: 4a22defcb1151912337d4167ac49852519c7789d
2019-12-09 16:11:36 -08:00
Genevieve Helsel
0907d3adda save loadFileFromPath in DiffContext
Summary: Saves loadFileFromPath in the DiffContext. This allows the source control differ ( at `eden/fs/store/Diff.cpp`) to call this function while it is trying to load gitIgnores and resolve symlinks.

Reviewed By: simpkins

Differential Revision: D18647088

fbshipit-source-id: bddff0158130f0c96ac263bcce81dc51fc017800
2019-12-09 11:33:23 -08:00
Genevieve Helsel
c8bdf32bc9 introduce EdenMount::loadFileContentsFromPath
Summary: Adds a helper function that can take a path to an Inode and load a file by simply getting the Inode then calling the existing `loadFile()` function

Reviewed By: simpkins

Differential Revision: D18647090

fbshipit-source-id: 89c25bef10a7a0d0ffd660293f85479ac0e9f9a9
2019-12-09 11:33:23 -08:00
Genevieve Helsel
32fb62cedf move gitignore loading to EdenMount as EdenMount::loadFileContents
Summary: Move the bulk of the gitignore loading to EdenMount, this is needed later in the stack to pass this function as a callback through the DiffContext to enable gitignore loading from the source control tree differ.

Reviewed By: simpkins

Differential Revision: D18565265

fbshipit-source-id: 062349d81bbfb78235ccb34d6ec72ad445a6e2b0
2019-12-09 11:33:23 -08:00
Adam Simpkins
cf4ef20aaa increase the log level for globFiles() thrift calls
Summary:
Increase the log level for messages about `globFiles()` thrift calls so that
they are enabled by default in our normal production configuration.

`globFiles()` calls can potentially cause EdenFS to fetch a lot of data, so it
is useful to be able to see them in the logs when investigating performance
issues.

Reviewed By: genevievehelsel

Differential Revision: D18820280

fbshipit-source-id: e351a9541e420f5eb47ca14d6620366437773ce4
2019-12-04 16:29:12 -08:00
Adam Simpkins
e6de5c6c3e drop the log level of a debug message in LocalStore.cpp
Summary:
This message is pretty noisy when running EdenFS with an increased debug
logging level.  Bump the debug level down so it doesn't spam the logs when
running at a slightly elevated debug level.  Also fix a minor typo.

Reviewed By: fanzeyi

Differential Revision: D18820281

fbshipit-source-id: 668367337f4a8cf2a38003c8e0034969d335c2c0
2019-12-04 16:29:12 -08:00
Genevieve Helsel
ff441bf0a6 clean up DiffTrees code
Summary: There are a couple of functions in `store/Diff.h` which are not used elsewhere except for testing. These functions are tested by `diffCommitsForStatus()` anyways so these standalone functions are not needed.

Reviewed By: chadaustin

Differential Revision: D18690006

fbshipit-source-id: f2b24575c17403d7241896f35f4e0e16bb03b7ce
2019-12-04 16:01:48 -08:00
Chad Austin
be9ea834ca remove the redundant inode number from UnloadedInode
Summary:
Each entry in InodeMap::unloadedInodes_ stored the InodeNumber
twice. Remove one of them.

Reviewed By: wez

Differential Revision: D18651007

fbshipit-source-id: be85c34cb2b38fc0b2875d0874cecd1ef274aca4
2019-12-04 13:30:19 -08:00
Chad Austin
6b168708d9 readability improvements to diff code
Summary: Small readability improvements I noticed while reading the diff algorithm.

Reviewed By: genevievehelsel

Differential Revision: D18650987

fbshipit-source-id: 19346362711455ae87d6770812e647544a4576bf
2019-12-04 13:30:18 -08:00
Chad Austin
f930a40434 make PathComponentPiece and RelativePathPiece constexpr
Summary: Allow creation of PathComponentPiece and RelativePathPiece values at compile-time.

Reviewed By: wez

Differential Revision: D18642594

fbshipit-source-id: 209e5c27e8fab1e877ccee8558fa757b68078e66
2019-12-04 13:30:18 -08:00
Chad Austin
3a625fda68 build cleanly with -Wextra-semi
Summary: Remove unnecessary semicolons in preparation for adding -Wextra-semi.

Reviewed By: wez

Differential Revision: D18784373

fbshipit-source-id: 2fe8366defc2b8d79a4585a4e961a6fe84b91c67
2019-12-03 15:04:27 -08:00