Commit Graph

876 Commits

Author SHA1 Message Date
Chad Austin
6fd2db3802 add hg import queue events to ActivityBuffer
Summary:
This is a slight behavior change, but I need queue events published to
ActivityBuffer so I can track the live set of fetches.

The impact will be that `eden trace hg --retroactive` will show 2/3 of
the number of events that it did. We can bump the capacity if that's
problematic.

Reviewed By: xavierd

Differential Revision: D44594520

fbshipit-source-id: 5b22169403402d729ff929b4b4bec6bb76d54737
2023-04-04 10:42:45 -07:00
Chad Austin
c590ea8a82 unconditionally enable HgQueuedBackingStore's ActivityBuffer
Summary:
ActivityBuffer is enabled by default and we rely on `eden trace hg
--retroactive` working. For HgQueuedBackingStore, unconditionally
enable ActivityBuffer, and give a capacity config setting independent
from the others.

Reviewed By: xavierd

Differential Revision: D44593656

fbshipit-source-id: 284bad0d19315d250a4ab69f06439393dbeaf5d1
2023-04-04 10:42:45 -07:00
Chad Austin
29bc2406ff fix the activityBufferMaxEvents ConfigSetting's case
Summary: We only capitalize type names.

Reviewed By: xavierd

Differential Revision: D44593407

fbshipit-source-id: 9f0d841e6ff5c40d6a6c6ca3637a40fefcf5d084
2023-04-04 10:42:45 -07:00
Chad Austin
100ee511c0 minor comments
Summary:
While reading through our uses of ActivityBuffer, I noticed an
opportunity to amortize the cost of publishing import events.

Add some comments to note that.

Reviewed By: xavierd

Differential Revision: D44643270

fbshipit-source-id: 1b68f904b86d91fab91af01a4e8b169dc381ad33
2023-04-03 23:40:55 -07:00
Xavier Deguillard
51c5503e98 service: support remote fetching from eden debug blobmeta
Summary:
Now that EdenFS can fetch blob metadata from the server, let's make sure to
plug it to the `eden debug blobmeta` command.

Reviewed By: kmancini

Differential Revision: D44186943

fbshipit-source-id: a64f1384cf312e3c677505c330cfc82469fb83f3
2023-03-29 15:35:52 -07:00
Xavier Deguillard
e8c214db57 store: support fetching aux data via ObjectStore
Summary:
Now that the Mercurial backingstore knows how to fetch aux data, let's thread
this through the ObjectStore.

Reviewed By: kmancini

Differential Revision: D44110102

fbshipit-source-id: c57da05066d80fee199e45b4a4223168a196e3de
2023-03-29 15:35:52 -07:00
Katie Mancini
aedf3967a0 remove multiple unnessecary retries within hg importer fetches
Summary:
Currently a single eden fetch causes 13 attempts to fetch the data.

By default hg hs 3 configured retries for edenapi fetch operations.

In the direct rust fetching code we have disabled these retries because we
use the importer as a retry, so these are not worth it.

We should disable them in the importer too.

There are still many retries. The importer internally will attempt 2 retries
and eden retries the importer once when it fails. So there are at least 5
attempts to fetch data still.

Those other retries are perhaps ensuring correctness, so we need to be more
careful with them. But these should be safe to remove.

This is a 3x reduction in retry attempts.

Reviewed By: fanzeyi

Differential Revision: D44482325

fbshipit-source-id: 96a501c8e9421e5d8aef92b697a6ed5e19c69194
2023-03-29 11:35:29 -07:00
Chad Austin
e419dd2799 remove the reference-counting overhead from DurationScope
Summary:
DurationScope has a pair of atomic reference count operations at the
beginning and end of every recorded duration. To avoid that overhead,
reference EdenStats with RefPtr and, in production EdenFS, store a
global, unowned EdenStats object.

This gives us the benefits of explicit dependencies and no global
state in tests, while avoiding atomic RMWs in the release build.

Reviewed By: xavierd

Differential Revision: D44323723

fbshipit-source-id: 1b3384d2e6a0a2959fd79774a8ba46afc4c176ca
2023-03-24 13:50:40 -07:00
Chad Austin
5aa50eb024 remove some unnecessary includes from ObjectStore.h
Summary:
ObjectStore.h includes too many headers. Replace several with forward
declarations.

Reviewed By: xavierd

Differential Revision: D44323736

fbshipit-source-id: 944cd72fd758df4363493f87a573d91245a45b6a
2023-03-23 20:04:45 -07:00
Xavier Deguillard
553b4278a0 main: move folly::init default configuration to main
Reviewed By: fanzeyi

Differential Revision: D44263797

fbshipit-source-id: 61a219e98b96f61495eb549c0e01ca635ab29e9f
2023-03-21 14:17:32 -07:00
Pierre Chevalier
493f85d012 Ignore more memory leaks introduced by the libgit2 upgrade
Summary:
As of the libgit2 upgrade from 0.27.2 to 0.28.5 in D43195307, asan has been complaining about memory leaks coming from libgit2.

It initially caused 468 test failures.
D44096350 fixed 403 of these tests, but 65 are still failing.

Running one of these, we can see two other memory leaks (see test plan) being higlighted.

Mute them.

Differential Revision: D44254572

fbshipit-source-id: 8ae49c49542dda954f66de18cb756709d0c624d3
2023-03-21 07:00:16 -07:00
Pierre Chevalier
82dd44934f Ignore memory leaks introduced by the libgit2 upgrade
Summary:
As of the `libgit2` upgrade from `0.27.2` to `0.28.5` in D43195307, `asan` has been complaining about memory leaks coming from `libgit2`.

This caused 468 tests failures as reported in this task: T147770506.

An initial investigation hasn't quickly led to a resolution of the source of the memory leaks.

Get the tests back to green by suppressing the memory leaks detection from ASAN.
AddressSanitizer: 480 byte(s) leaked in 4 allocation(s).
/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/testcase.py:92: === clean up done at 93.718s (+10.623s)
ERROR

======================================================================
ERROR: test_eden_list (eden.integration.rc_test.RCTestNFSGit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/async_case.py", line 72, in _callCleanup
    self._callMaybeAsync(function, *args, **kwargs)
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/async_case.py", line 84, in _callMaybeAsync
    ret = func(*args, **kwargs)
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/testcase.py", line 158, in <lambda>
    self.addCleanup(lambda: self.eden.cleanup())
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 134, in cleanup
    self.kill()
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 143, in kill
    self.shutdown()
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 434, in shutdown
    raise Exception(
Exception: eden exited unsuccessfully with status 1

----------------------------------------------------------------------
Ran 1 test in 93.725s

FAILED (errors=1)

Exception: eden exited unsuccessfully with status 1
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/case.py", line 717, in doCleanups
    self._callCleanup(function, *args, **kwargs)
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/async_case.py", line 72, in _callCleanup
    self._callMaybeAsync(function, *args, **kwargs)
  File "/usr/local/fbcode/platform010/lib/python3.8/unittest/async_case.py", line 84, in _callMaybeAsync
    ret = func(*args, **kwargs)
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/testcase.py", line 158, in <lambda>
    self.addCleanup(lambda: self.eden.cleanup())
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 134, in cleanup
    self.kill()
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 143, in kill
    self.shutdown()
  File "/data/sandcastle/boxes/fbsource/buck-out/v2/gen/fbcode/94ab8015be307995/eden/integration/__rc__/rc#link-tree/eden/integration/lib/edenclient.py", line 434, in shutdown
    raise Exception(

Buck UI: https://www.internalfb.com/buck2/947a3357-9a80-4a15-b067-fbad6a615fd0
Test UI: https://www.internalfb.com/intern/testinfra/testrun/3096224848534397
RE: reSessionID-765a77c0-c485-4182-be99-f7431d285752  Up: 312 KiB  Down: 498 KiB
Jobs completed: 31. Time elapsed: 109.0s. Cache hits: 100%. Commands: 2 (cached: 2, remote: 0, local: 0)
Tests finished: Pass 4. Fail 4. Fatal 0. Skip 0. 0 builds failed
4 TESTS FAILED
  ✗ fbcode//eden/integration:rc - test_unmount_rmdir (eden.integration.rc_test.RCTestNFSGit)
  ✗ fbcode//eden/integration:rc - test_eden_list (eden.integration.rc_test.RCTestGit)
  ✗ fbcode//eden/integration:rc - test_unmount_rmdir (eden.integration.rc_test.RCTestGit)
  ✗ fbcode//eden/integration:rc - test_eden_list (eden.integration.rc_test.RCTestNFSGit)B
```

After:
```
Buck UI: https://www.internalfb.com/buck2/7091ae16-eb5f-425d-8922-cf278987acb3
Test UI: https://www.internalfb.com/intern/testinfra/testrun/3940649832205800
RE: reSessionID-a06bbda7-b3c4-46c6-998f-7e2280bb7ad8  Up: 558 B  Down: 0 B
Jobs completed: 11. Time elapsed: 113.5s.
Tests finished: Pass 8. Fail 0. Fatal 0. Skip 0. 0 builds failed
```

Reviewed By: kmancini

Differential Revision: D44096350

fbshipit-source-id: 1c8a5308759f2dc90e00b33b8f4e19f2ca53f54f
2023-03-20 08:50:21 -07:00
Xavier Deguillard
afdbd9c2d6 store: fix a typo
Reviewed By: genevievehelsel

Differential Revision: D44110106

fbshipit-source-id: 801aacb3cd1888f10e49c40eaf43640341034a91
2023-03-17 14:13:02 -07:00
Xavier Deguillard
8eb72c47a7 store: allow batch of aux data to be fetched
Summary:
Nothing is being enqueued just yet, but this teaches EdenFS how to fetch
batches of aux data.

In the case where the aux data cannot be fetched, a nullptr auxdata is returned
to the higher level which will then trigger a blob fetch to compute aux data.

Reviewed By: chadaustin

Differential Revision: D44110104

fbshipit-source-id: 53df1496addf3a9dae521ffcdba5b060b8fce16a
2023-03-17 14:13:02 -07:00
Xavier Deguillard
ecc972bd74 store: add support for aux data in hg import queue
Summary:
As a first step towards enabling aux data fetching, we need to allow aux data
to be batch fetched.

Reviewed By: chadaustin

Differential Revision: D44110105

fbshipit-source-id: f9c3f55ffdc5554784b5f38457ef675689664263
2023-03-17 14:13:02 -07:00
Xavier Deguillard
838419fceb service: expose AUX fetching counters and watches through the stack
Summary:
Currently, EdenFS doesn't perform any aux data fetching, instead it fallback to
fetching blobs. In some cases, this can be extremely expensive when the aux
data store is emptied/flushed/rotated leading to non deterministic performance.
On Windows in particular, directory listing always need blob sizes, and thus
getting aux data reliably is critical.

As a first step, let's add some watches through the stack and expose these to
Thrift. This will allow `eden top` and `eden trace hg` to display these
fetches correctly.

Reviewed By: chadaustin

Differential Revision: D44105497

fbshipit-source-id: a3dc5cce1bc3115a2a4effcece6fa0cf0b16f6c8
2023-03-17 14:13:02 -07:00
Xavier Deguillard
e3440801f3 store: remove unecessary move
Summary: By using reference everywhere, we can save on several moves.

Reviewed By: chadaustin

Differential Revision: D44101377

fbshipit-source-id: 9aa9d89570fb0432477e632d108109d292fa63bb
2023-03-17 14:13:02 -07:00
Xavier Deguillard
5479f3c911 inode: enhance checkout telemetry
Summary:
Understanding how many trees and blobs were accessed but not fetched during
checkout is a useful metric that informs us as to how much was served from
caches. This is useful as checkout is more or less proportional in time to the
number of accessed inodes and the number of accessed trees+blobs will thus tell
us how many TreeInode and FileInode were loaded and traversed.

Reviewed By: chadaustin

Differential Revision: D44117153

fbshipit-source-id: 56991c51f2e4f501486d64ab5598f149f2708b77
2023-03-16 11:27:06 -07:00
Xavier Deguillard
7d1b532a00 store: remove TreeMetadata
Summary: This is no longer used, remove it.

Reviewed By: chadaustin

Differential Revision: D44073360

fbshipit-source-id: b8d1c6228718d8e0b58dc39ab2b70ef0f0cab192
2023-03-15 09:54:48 -07:00
Xavier Deguillard
081deabbdb store: use HgProxyHash instead of Hash20
Summary:
A Hash20 could be anything, while a HgProxyHash is well defined. Use the latter
to clear some confusion and to be consistent with the Tree and Blob functions.

Reviewed By: genevievehelsel

Differential Revision: D44046388

fbshipit-source-id: 38dd08cd1c321145facc7f660aacccc3198a219b
2023-03-14 17:14:26 -07:00
Xavier Deguillard
da64d926b5 store: preemptively write aux data to the LocalStore
Summary:
The Sapling backing store now provides both size and sha1 in the TreeEntry,
thus we can pre-compute the metadata and store it in the LocalStore to avoid a
roundtrip to the Saplig backing store when that metadata will be needed very
shortly.

Reviewed By: kmancini

Differential Revision: D43132760

fbshipit-source-id: 38dcba76d41e5801c8b716197af179543386df08
2023-02-23 17:00:41 -08:00
Giuseppe Ottaviano
076cb3c4e7 Implement HgImporterThreadFactory in terms of InitThreadFactory
Reviewed By: xavierd

Differential Revision: D43155174

fbshipit-source-id: 28bde2dae9e6ffe1e3d61b02a039661bd6fef50b
2023-02-10 12:05:49 -08:00
Xavier Deguillard
a697a5173f remove unecessary explicit ImmediateFuture construction
Summary:
All of these functions are returning an ImmediateFuture already, so there is no
need to construct another ImmediateFuture on top.

Reviewed By: mshroyer, fanzeyi

Differential Revision: D42788619

fbshipit-source-id: b40cd1027d183920e858cb21c91ee7b14d2ea929
2023-01-27 16:04:07 -08:00
Katie Mancini
b1fed80351 implement debugGetBlobMetadata
Summary:
Some times EdenFS has corrupt data, its helpful to be able to see where that
corrupt data is stored. I updated `eden debug blob` a while back to show
blob data from multiple places: D41165544 (224cde1d5c).

In this stack I am going to do the same for blob metadata, so we can
understand where corrupt data is comming from.

This diff implements that new endpoint and adds some tests for it.

Reviewed By: mshroyer

Differential Revision: D42283193

fbshipit-source-id: 8f5f684176d2a905c74c8d3add19abd57c4599ad
2023-01-27 14:35:09 -08:00
Zeyi (Rice) Fan
b31f6e3369 inodes: trace globbing related code
Summary: This diff adds `TaskTraceBlock` to globbing code so we can understand which thread are these code being executed on.

Reviewed By: chadaustin

Differential Revision: D41527107

fbshipit-source-id: a001f473795e413d2bf4a8125389867a1629515b
2023-01-18 16:41:25 -08:00
Chad Austin
412faa4594 clean up timing of ObjectCache benchmarks
Summary:
Google Benchmark automatically measures iteration time, so there's no
need to manually measure the cost of an operation. Instead, we can
just lift all of the setup work out of the benchmark iteration loop.

This diff also removes use of divisions and floats in the benchmark
loop.

Reviewed By: xavierd

Differential Revision: D42180588

fbshipit-source-id: d51621ed1057acd26e92342c28dfa9f10b0c11be
2022-12-21 10:46:20 -08:00
Chad Austin
35db05f424 switch FaultInjector to ImmediateFuture
Summary:
Most of the time, FaultInjector is a no-op, so it's a perfect
candidate for ImmediateFuture.

Reviewed By: xavierd

Differential Revision: D42086041

fbshipit-source-id: e93f0c707a8d8f42be967b2b394d1724a0b83649
2022-12-19 13:11:02 -08:00
Chad Austin
f4d8aba2bf replace ImmediateFuture's default constructor with an in_place constructor
Summary:
For parity with Future and SemiFuture, remove ImmediateFuture's
default constructor and replace it with `makeEmpty()` and a
`std::in_place` constructor overload.

Reviewed By: xavierd

Differential Revision: D41293865

fbshipit-source-id: 43abae81fed3d99a5b4124d8c598dcce921ef65b
2022-12-19 13:11:02 -08:00
Chad Austin
a92cd39d70 rename ConfigSource to ConfigSourceType
Summary:
I'm about to introduce an interface named ConfigSource, which
awkwardly conflicts with this enum. Rename ConfigSource to
ConfigSourceType. I considered ConfigSourceSlot, but slot seems more
of an implementation detail.

Reviewed By: kmancini

Differential Revision: D41830066

fbshipit-source-id: 85a54f4243b14c693087c7555e27b5473e90562e
2022-12-10 05:09:52 -08:00
Chad Austin
cee24e0533 remove some dead EdenConfig code
Summary: EdenConfig had some remnants of old cruft. Remove them.

Reviewed By: xavierd

Differential Revision: D41744767

fbshipit-source-id: d5fd50fa599c15ec8b748c323c45ea1e7eb8ddcd
2022-12-08 17:11:17 -08:00
Xavier Deguillard
b222334462 store: add a fast path to compare blobs
Summary:
Obtaining the SHA1 of a blob while cheap can start becoming very expensive when
tons of them are requested. Let's do a cheap ObjectID comparison first to avoid
them.

Reviewed By: chadaustin

Differential Revision: D41660610

fbshipit-source-id: 192e9d51cf1eeba3ea3148b90adda685fe7d251f
2022-12-06 12:29:03 -08:00
Chad Austin
080029b499 have ImmediateFuture require T be noexcept-move
Summary:
Exception safety has costs. Namely, exception-safe code needs to
support rolling back, and reasoning about correctness is
hard. Therefore, now that our Path and PathPiece types are
noexcept-move, have ImmediateFuture require the type that it holds be
noexcept-move. Types that aren't noexcept-move can be passed by
unique_ptr.

Reviewed By: kmancini

Differential Revision: D41293189

fbshipit-source-id: 770bd4ac7818256d83f8ff50f27c6977147b8209
2022-12-02 21:36:25 -08:00
Chad Austin
6b9aaa6120 prepare EdenFS tests for a world without HgImporter
Summary:
EdenFS's tests still fall back on a debugedenimporthelper process to
import trees and blobs. That's because the test repos still use the
deprecated revlog format. Migrate the test repos to use indexedlog
storage so that SaplingNativeBackingStore hits.

Note: This repo configuration is awkward and temporary, and the
Sapling team is planning to migrate to "Eager" repos to support the
`hg init` case in the future.

Reviewed By: quark-zju

Differential Revision: D41447075

fbshipit-source-id: 23c2f13dfc9f964d9386d7f4c920222db8f25144
2022-12-01 15:02:14 -08:00
Chad Austin
2c1bf63afe add a get_tree and get_blob counter
Summary: Add store.hg duration counters that cover indexedlog hits.

Reviewed By: xavierd

Differential Revision: D41566559

fbshipit-source-id: 94cb35f59527a2b2bdcb5e8e29f2793b19830a68
2022-12-01 15:02:14 -08:00
Chad Austin
4c23260289 rename the inaccurate hg get_blob and get_tree counters to fetch_blob and fetch_tree
Summary:
get_tree and get_blob were misleading counters. They did not include
reads from disk. In preparation for adding encompassing get_tree and
get_blob counters, rename to fetch_tree and fetch_blob.

Reviewed By: xavierd

Differential Revision: D41566434

fbshipit-source-id: eae98035f4d0c366f58c6c22eda42ae5c537c8e4
2022-12-01 15:02:14 -08:00
Chad Austin
5787485710 standardize HgRepo creation across C++ tests
Summary:
EdenFS's C++ unit tests unnecessarily differed in how they initialized
test repositories. Move
scmstore/treemanifest/remotefilelog/etc. configuration into hgInit so
it's the same everywhere.

Reviewed By: genevievehelsel

Differential Revision: D41364290

fbshipit-source-id: 24f882766bf00c6546663e0712b6029153a4a699
2022-11-30 17:39:54 -08:00
Chad Austin
47acf1de9d backingstore: unconditionally enable file aux data for EdenFS
Summary:
EdenFS always wants blob metadata. Remove the option for not fetching
it.

Reviewed By: genevievehelsel

Differential Revision: D41364132

fbshipit-source-id: ffab62af57e6b35cbfd4cb4854262af669155b8e
2022-11-30 17:39:54 -08:00
Chad Austin
e9323a62f0 add config knobs to disable tree and blob import fallbacks
Summary:
In preparation for removing EdenFS's fall back onto hg importer tree
and blob fetches, add config knobs that allow us to slowly roll out
the behavior change across platforms.

Reviewed By: xavierd

Differential Revision: D41346959

fbshipit-source-id: a177b0fefd5d471951435a5254318306091630d6
2022-11-30 17:39:54 -08:00
Chad Austin
715212bad2 minor HgDatapackStore refactoring
Summary: Small refactorings to reduce noise in further diffs.

Reviewed By: genevievehelsel

Differential Revision: D41346800

fbshipit-source-id: 6824487f91f811f040cd51c9b41c0227f49fdd49
2022-11-30 17:39:54 -08:00
Chad Austin
8f9ee83e76 rearrange methods in tree, blob, blobmetadata order in HgDatapackStore
Summary:
I'm standardizing all of our *Store classes on the following method
order: tree, blob, blob metadata.

This diff has no behavior changes, and only moves code.

Reviewed By: genevievehelsel

Differential Revision: D41346763

fbshipit-source-id: bb5f5fb63c9cfccdffff90c404d677c4cf751d40
2022-11-30 17:39:54 -08:00
Chad Austin
8f86a29e0e propagate fetch errors out of SaplingNativeBackingStore
Summary:
The previous SaplingNativeBackingStore API dropped errors on the
floor. But it would be useful to propagate them outwards, so return a
Try and ensure the callback is invoked for every requested node.

Reviewed By: xavierd

Differential Revision: D41328023

fbshipit-source-id: e5e5bbe26aff16e99efe8a8c3ff6d020d3691615
2022-11-30 12:31:01 -08:00
Chad Austin
7cda69b640 move HgImportRequestQueue benchmarks next to its tests
Summary:
Benchmarks for individual subsystems generally live next to the
tests. `eden/benchmarks` is primarily integration-level benchmarks, so
move the HgImportRequestQueue benchmarks next to the tests.

Reviewed By: genevievehelsel

Differential Revision: D41568442

fbshipit-source-id: a5278a9dc0b7310bd409e9ab64d05d05c7917701
2022-11-29 16:03:26 -08:00
Xavier Deguillard
b7d87d807a utils: deny building an AbsolutePath from a literal
Summary:
We've had a couple of failures after landing D40818724 (f199e93924) due to some places still
building AbsolutePath from a literal. On Windows, this is almost always a bug
due to paths usually not being UNC.

To avoid this issue, we can simply forbid an AbsolutePath from being built in
the first place from a path, instead forcing the use of canonicalPath. This was
suggeted by mshroyer in the orignal diff.

Reviewed By: chadaustin

Differential Revision: D41229194

fbshipit-source-id: 3451bdcba276c87f98326b025e05f6a4eddbd1b7
2022-11-22 16:20:30 -08:00
Chad Austin
8ccb597f09 backingstore: remove the need for names in the backing store bindings
Summary:
This is follow-on from D41033644. Remove the name parameter from our
FFI bindings, since it is no longer necessary. In the future, if paths
are required again, we can store them in a variable-width node
component.

Reviewed By: genevievehelsel

Differential Revision: D41034415

fbshipit-source-id: a279e01d447d9f509e283f09453b831e0ec5cedd
2022-11-17 19:56:38 -08:00
Chad Austin
e477e45aa8 backingstore: remove a vector copy and allocation on every batch request
Summary:
All of the lambdas involved are called within the outer
scope. Therefore, the captures should be implicit and by
reference. This avoids a vector copy per batch.

Reviewed By: xavierd

Differential Revision: D41034079

fbshipit-source-id: 057e397c1c98f619599472af46ddcedbc15a2288
2022-11-17 19:56:38 -08:00
Chad Austin
3b6aa14fc8 backingstore: rename RustBackingStore and HgNativeBackingStore
Summary:
On the hg side, let's consistently use the namespace sapling, and
instead of using the word "Rust" in the API, let's call them bindings.

Reviewed By: xavierd

Differential Revision: D40959727

fbshipit-source-id: 687c8c78fd69e2478dfbf5b0573c3bccec340ce3
2022-11-17 19:56:38 -08:00
Chad Austin
5fcb37cab3 backingstore: replace the Rust prefix with a sapling namespace
Summary:
Instead of introducing our binding types in the global namespace with
the prefix "Rust", use a sapling namespace. The fact that the code is
in Rust is an implementation detail: the important thing is that these
types are on the other side of the project boundary.

Reviewed By: genevievehelsel

Differential Revision: D40925131

fbshipit-source-id: 85c25a0e989e9267625459a355d3739ff8686638
2022-11-17 19:56:38 -08:00
Chad Austin
a1bc268963 port Path and PathPiece from folly::StringPiece to std::string_view
Summary:
std::string_view has noexcept accessors and folly::Range doesn't, so
this allows us to make Path and PathPiece noexcept.

Reviewed By: kmancini

Differential Revision: D41145426

fbshipit-source-id: 046f6f6a532d8d0da8508ccf7896c914e19a25ec
2022-11-16 18:09:51 -08:00
Chad Austin
cab61b9d46 backingstore: introduce a BackingStoreOptions struct
Summary:
Boolean arguments bad. Structs with descriptive fields good. Pass
BackingStoreOptions as a struct.

Reviewed By: xavierd

Differential Revision: D40922822

fbshipit-source-id: 2ad1fd6ccbb87db672f9e85d950a66cc47fe4ab2
2022-11-15 17:32:03 -08:00
Chad Austin
acb2e230b5 don't check edenapi config setting and hardcode edenapi on
Summary:
We no longer need a kill switch on edenapi fetches. Stop accessing the
config and always configure backing stores with edenapi on.

Reviewed By: genevievehelsel

Differential Revision: D40909096

fbshipit-source-id: fbdb01fc74add870b95d0bcc46be6b4bf9323898
2022-11-15 16:23:30 -08:00