Commit Graph

1054 Commits

Author SHA1 Message Date
Thomas Orozco
95cc0e5a30 revisionstore: log more info when we time out
Summary:
Right now we just get a "deadline exceeded" error, which isn't very amenable to
helping us understand why we timed out. Let's add more logging. Notably,
I'd like to understnad what we've actually received at this point, if anything,
and how long we waited, as I'm starting to suspect this issue doesn't have much
to do with HTTP.

See https://fb.workplace.com/groups/scm/permalink/3361972140519049/ for
more context.

Reviewed By: quark-zju

Differential Revision: D25128159

fbshipit-source-id: b45d3415526fdf21aa80b7eeed98ee9206fbfd12
2020-11-23 01:45:54 -08:00
Durham Goode
dacb852353 edenapi: make http version configurable
Summary:
We've seen some hangs with http 2 in lfs. Switching to http 1.1 seems
to fix it. Let's make this configurable so we can tweak this if we see it in
edenapi. For now we continue to default to http 2.

Reviewed By: krallin

Differential Revision: D24901201

fbshipit-source-id: 9806e2c37fa299e4bd381ebdcb17d00800408de3
2020-11-16 10:05:19 -08:00
Wez Furlong
98c18ed7a8 edenfs: brace for macfuse
Summary:
osxfuse is rebranding as macfuse in 4.x.

That has ripple effects through how the filesystem is mounted and shows up in
the system.

This commit adjusts for the new opaque and undocumented mount procedure and
speculatively updates a couple of other code locations that were sensitive to
looking for "osxfuse" when examining filesystems.

Reviewed By: genevievehelsel

Differential Revision: D24769826

fbshipit-source-id: dab81256a31702587b0683079806558e891bd1d2
2020-11-12 18:09:19 -08:00
Durham Goode
21468d204c lfs: make lfs http version configurable
Summary:
We've seen http 2 potentially causing hangs for users. Let's make this
configurable for lfs, so we can disable it and see if things get fixed.

Reviewed By: krallin

Differential Revision: D24898322

fbshipit-source-id: dc7842c0247dc6b9590a1f160076b17788aab1b9
2020-11-12 10:59:50 -08:00
Durham Goode
d219661164 http-client: make http version configurable
Summary:
As discussed in a group thread (see link below), HTTP 2 may be causing
hangs for users. Let's start by making the http-client configurable. In
subsequent diffs we'll make edenapi and lfs configurable as well.

Reviewed By: krallin

Differential Revision: D24898323

fbshipit-source-id: f0035a1b8df3cee626ebe519e9e99358c1b3f043
2020-11-12 10:59:50 -08:00
Thomas Orozco
3493466385 thrift/compiler: annotate Rust doctests as just text
Summary:
This isn't code that compiles, but the convention in Rust is that code actually
is doctests unless annotated otherwise, so if tested with Cargo, those fail.

This fixes that.

Reviewed By: farnz

Differential Revision: D24917364

fbshipit-source-id: 62fe11700ce561c13dc5498e01d15894b17b5b22
2020-11-12 06:01:47 -08:00
Stefan Filip
451d6758ec edenapi: add segmented changelog clone endpoints
Summary:
Transfers iddag flat segments along with the head_id that should be use to
rebuild a full fledged IdDag. It also transfers idmap details. In the current
version it only transfers universal commit mappings.

Reviewed By: krallin

Differential Revision: D24808329

fbshipit-source-id: 4de9edcab56b54b901df1ca4be5985af2539ae05
2020-11-11 22:53:38 -08:00
Stefan Filip
e5ada2f396 types: add WireCloneData
Summary: Serialization format for dag's CloneData.

Reviewed By: quark-zju

Differential Revision: D24717926

fbshipit-source-id: 51f3aa189260a4062cfd75e412b98defd2a8cf94
2020-11-11 22:53:37 -08:00
Liubov Dmitrieva
b83f4e3243 remove old subscription
Summary:
BE: remove old subscription to save resources in IceBreaker. The client code will recreate it anyway if missing but cleaning up will help us to reduce number of unused subscriptions.

Classic example: repo opsfiles or configerator maybe needed once and then a user don't use

Another example: switching workspaces failed and it could be result in subscriptions are not cleaned up properly

Reviewed By: markbt

Differential Revision: D24859931

fbshipit-source-id: 6df6c7e5f95859946726e04bce8bc8f3ac2d03df
2020-11-11 05:17:47 -08:00
Stefan Filip
4f70ffdff8 dag: update IdDag::universal_id visibility to public
Summary:
This function is useful in the mononoke to compute the universal commit idmap
that is required for clone.

Reviewed By: quark-zju

Differential Revision: D24808327

fbshipit-source-id: 0cccd59bd7982dd0bc024d5fc85fb5aa5eafb831
2020-11-10 16:47:23 -08:00
Stefan Filip
d00281f8dc dag: add IdDag::flat_segments
Summary:
`flat_segments` are going to be used to generate CloneData. These segments will
be sent to a client repository and are going to bootstrap the iddag.

Reviewed By: quark-zju

Differential Revision: D24808331

fbshipit-source-id: 00bf9723a43bb159cd98304c2c4c6583988d75aa
2020-11-10 16:47:23 -08:00
Stefan Filip
bff5a9ba29 dag: add CloneData
Summary: This is the object that will be used to bootstrap a Dag after a clone.

Reviewed By: quark-zju

Differential Revision: D24808328

fbshipit-source-id: 2c7e97c027c84a11e8716f2e288500474990169b
2020-11-10 16:47:23 -08:00
Stefan Filip
40333a545f dag: rename AssignHeadOutcome to PreparedFlatSegments
Summary:
The goal is to reused the functionality provided by AssignHeadOutcome for clone
purposes.

Reviewed By: quark-zju

Differential Revision: D24717924

fbshipit-source-id: e88f21ee0d8210e805e9d6896bc8992009bd7975
2020-11-10 16:47:23 -08:00
Durham Goode
a1d2d702d7 datastore: fix bug in indexedlogdatastore max log size
Summary:
The goal of this code was to divide the cache limit by the number of
logs. Instead it divided the cache limit by the default per-log size (2GB). That
results in a very small max-bytes-per-log so data was being thrown out
constantly. This fixes it and updates tests to actually demonstrate the issue.

Reviewed By: kulshrax

Differential Revision: D24712842

fbshipit-source-id: 8062758b5bfa40493e2003d5a9028d601b1522b1
2020-11-05 09:48:26 -08:00
Durham Goode
d2e3736f67 procinfo: fix buck build on OSX
Summary:
As part of getting buck build to work on OSX, we need procinfo to
include it's OSX specific library.

Reviewed By: sfilipco

Differential Revision: D24513234

fbshipit-source-id: 69d8dd546e28b4403718351ff7984ee6b2ed3d1d
2020-11-03 17:40:19 -08:00
Stefan Filip
07200876bb segmented_changelog: account for iddag lag in incremental build
Summary:
I initially saw the incremental build as something that would be run in places
that had IdMap and IdDag stored side by side in process. I am reconsidering
to use incremental build in the tailing process to keeps Segmented Changelog
artifacts up to date.

Since we update the IdMap before we update the IdDag, it is likely that we
will have runs that only update the IdMap and fail to update IdDags. This diff
adds a mechanism for the IdDag to catch up.

Reviewed By: krallin

Differential Revision: D24516440

fbshipit-source-id: 3a99248451d806ae20a0ba96199a34a8a35edaa4
2020-10-29 17:40:19 -07:00
Stefan Filip
2cce5b532b dag: update InProcessStore serialization
Summary: Removing redundant indexes from serialization.

Reviewed By: quark-zju

Differential Revision: D24580272

fbshipit-source-id: 49b1d6ae00e2f079dd0ed9d710afcd04b9744442
2020-10-28 14:55:59 -07:00
Stefan Filip
dc1edebf9e dag: benchmark for inprocess iddag serialization
Summary:
I am wondering whether we should customize the serialization format for the
InProcessStore. I want to have a basis for the comparison before I proceed.

Reviewed By: quark-zju

Differential Revision: D24580273

fbshipit-source-id: d3ddfdc029dbdd84f60acace06fddc80b4d005f4
2020-10-28 14:55:59 -07:00
Meyer Jacobs
5a6ef9c5f7 history: introduce separate wire types for history API
Summary: This change adds wire types for the history API in the most straightforward way possible. In a future change, I'll move the `WireHistoryEntry` / `HistoryResponseChunk` conversion logic into the `ToApi` implementation. This implementation also doesn't add per-item errors, or standardize `history` to match the protocol evolution standards used by `trees`.

Reviewed By: kulshrax

Differential Revision: D24342046

fbshipit-source-id: d46403a823f2a1e89ad9d6d2074241d8bfe4810e
2020-10-25 18:39:34 -07:00
Meyer Jacobs
41b1d08cd7 types: optimize serialization of fixed-length byte arrays
Summary: This change introduces custo `Serialize` and `Deserialize` implementations for wire types containing a fixed-length byte array. This change is more verbose than should be necessary. Because `TryFrom` is implemented to convert `&[T]` to `[T; N]` and `AsRef` to convert `[T; N]` to `&[T]`, we should be able to use a generic serde `with = ` attribute on the byte array fields of the appropriate structs. Unfortunately, I'm getting a lifetime issue that I haven't been able to resolve, and const generics aren't available on stable to implement the trait bounds without an explicit lifetime.

Reviewed By: kulshrax

Differential Revision: D24460527

fbshipit-source-id: d3a4179b833a523ce164d3df934e4cbdc2202546
2020-10-25 18:39:34 -07:00
Meyer Jacobs
02b7fcc90a trees: use separate type for child metadata entries
Summary:
Removes top-level metadata from `TreeEntry` and add a new, specialized type for carrying child entry metadata, `TreeChildEntry`. This change also fully removes the `revisionstore_types::Metadata` from EdenAPI trees, which is only used on files.

In a follow up change I'll optimize handlings of paths / path segments in `TreeChildEntry` keys. Right now they need to be joined manually.

Reviewed By: kulshrax

Differential Revision: D24434716

fbshipit-source-id: d0739471b1f6cef58b435e10b5fb774bfb08f7f6
2020-10-25 18:39:34 -07:00
Meyer Jacobs
0ccae1cef9 errors: introduce per-item errors to EdenAPI protocol
Summary: Rather than silently dropping entries which cannot be fetched, this change has the `WireTreeEntry` type carry optional error information, allowing it to be (de)serialized to / from `Result<TreeEntry, EdenApiServerError>` instead of a bare `TreeEntry`. Currently, handling of these failures is up to the individual application code, but it might be useful to introduce utility functions to drop failed entries and log errors.

Reviewed By: kulshrax

Differential Revision: D24315399

fbshipit-source-id: 94e4593b77cf2dc12d0dcc93d174c8a4eda95344
2020-10-25 18:39:34 -07:00
Durham Goode
3e747835e2 revisionstore: fix indexedlog max size limit
Summary:
indexedlogdatastore is supposed to use remotefilelog.cachelimit to set
the max size, but instead it was setting the max per-log size, which means the
max size was N times bigger. Let's fix that.

Reviewed By: xavierd

Differential Revision: D24483181

fbshipit-source-id: f33cedbfdbb318e9d5eb9fda497645050b93e9fe
2020-10-22 18:21:11 -07:00
Thomas Orozco
fdeafe05d7 don't generate server-side stubs in checked-in codegen
Summary:
In the next diff in this stack, I'm changing the Rust thrift library as well as
the codegen, and this is causing quite a bit of pain with regard to this
codegen that is checked in to the hg build:

- Regenerating the codegen isn't super obvious.
- The Sandcastle build fails because it uses the current codegen with the old
  library.

According to lukaspiatkowski, this has also been a problem in the past when Eden got
migrated to Tokio 0.2, so I'd like to save myself and others some pain by just
not generating the server side codegen and not checking it in, since it's
unused. This reduces the surface of stuff that might go out of sync.

#forcetdhashing

Reviewed By: markbt

Differential Revision: D23649604

fbshipit-source-id: d684bec427431a366de42c88e53072caa98d5b2f
2020-10-22 17:01:47 -07:00
Xavier Deguillard
cd549f96bb revisionstore: repair the LFS store during hg doctor
Summary:
Similarly to the indexedlogdatastore, the LFS stores can become corrupted on
power loss. This is happening fairly frequently on Windows Sandcastle due to
the OS being virtualized and power being cut abruptly.

For now this only attempts to repair the shared stores, in theory we could also
try to repair the local stores but haven't looked into it.

Reviewed By: DurhamG

Differential Revision: D24449202

fbshipit-source-id: 605a7943a0850b625bf00c514879b3da1ab2b406
2020-10-21 13:20:51 -07:00
Xavier Deguillard
c62cd9e8c8 revisionstore: move the repair logic from doctor
Summary:
The ContentStore/Metadatastore are made of several different stores, attempting
to expose all of them to Python to drive the repair logic from there would leak
implementation detail of how the stores are implemented.

Instead, let's simply expose a single `repair` function out of the
pyrevisionstore crate that takes care of repairing all of the underlying
stores. For now, this is just moving code around, but a future diff will
integrate the LFS stores.

Reviewed By: DurhamG

Differential Revision: D24449203

fbshipit-source-id: 1631ced9068716453cb404bf7e65cefbf2db5247
2020-10-21 13:20:51 -07:00
Jun Wu
91ab519edb streams: add API to prefetch commit text in a streaming fashion
Summary:
This will be used to avoid 1-by-1 fetching for the changelog backend with
commit text stored remotely.

Reviewed By: sfilipco

Differential Revision: D24321293

fbshipit-source-id: 9695c72166cadc0b167e2ce7fde822cdf6b1cea8
2020-10-20 18:40:58 -07:00
Jun Wu
a3ac43a23a rollout: use doublewrite changelog backend for hg-dev
Summary:
Turn on rust changelog (changelog2) for all hosts (except hgsql).

Turn on doublewrite backend for hg-dev hosts, triggered by pull.
Tests are mostly working, and I have been using it for weeks.

Reviewed By: singhsrb

Differential Revision: D24259759

fbshipit-source-id: b89a27f98a6d3d1e4ea187bf7b29f875d0e96e2e
2020-10-20 15:53:57 -07:00
Jun Wu
3a96a2a3ee hgcommits: stabilize order of inserting commits
Summary: Avoid HashSet or HashMap order to preserve the order of inserting commits.

Reviewed By: DurhamG

Differential Revision: D24214460

fbshipit-source-id: 66df2e0aba1820e6585f8da66897078f38abf82f
2020-10-20 15:24:28 -07:00
Jun Wu
2d60f9edc8 hgcommits: handle nullid and wdirid in streaming APIs
Summary:
The nullid and wdirid are special hg hashes that do not respect SHA1. They were
handled at the bindings layer. However the bindings layer cannot handle them
in a stream.  Therefore move it in hgcommits.

Reviewed By: DurhamG

Differential Revision: D24365330

fbshipit-source-id: e8dc6205351ec1a2304252b9ec446dda010e6295
2020-10-20 15:24:27 -07:00
Jun Wu
b35886ecdf streams: add logic to handle missing items
Summary:
In case the server does not respect the input contract and missed
some items without returning errors. The current logic would retry
forever. Change it to detect the issue and raise an error.

Reviewed By: DurhamG

Differential Revision: D24293497

fbshipit-source-id: 09421c7743078a488a9c81ce66fd92c12b39543c
2020-10-20 15:24:27 -07:00
Jun Wu
3942b0cbe6 hgcommits: fix commit writing for hybrid backend
Summary: The store stores sorted(p1,p2)+text to match SHA1 hashes. It's not just `text`.

Reviewed By: DurhamG

Differential Revision: D24325554

fbshipit-source-id: 8a91970f60fb535ca1a5a2d30c7d27f2714f28de
2020-10-20 15:24:27 -07:00
Jun Wu
75ae217850 dag: remove NameDagStorage
Summary: It's no longer useful as the new abstract interface does not need it.

Reviewed By: sfilipco

Differential Revision: D24399516

fbshipit-source-id: 2b6735d2a26706c6a3e6b592d2f3ecfc874c94cb
2020-10-20 15:19:31 -07:00
Jun Wu
24edf32eac dag: impl MemNameDag using AbstractNameDag
Summary:
This verifies the abstraction and simplifies the code.

The new code will use non-master segments for add_heads. Therefore the test
changes.

Reviewed By: sfilipco

Differential Revision: D24399496

fbshipit-source-id: 39067ad88ade79b4f7758bcdaafc03e5f34ced91
2020-10-20 15:19:31 -07:00
Jun Wu
72c4a10e7e dag: move indexedlog NameDag to a module
Summary: This makes the main namedag.rs cleaner. The next step is to move MemNameDag.

Reviewed By: sfilipco

Differential Revision: D24399495

fbshipit-source-id: c1e79a60edd8597fe7264f04548e5312414241a7
2020-10-20 15:19:31 -07:00
Jun Wu
ddf2468f00 dag: impl Debug for AbstractNameDag
Summary: This is the last non-abstract interface of NameDag.

Reviewed By: sfilipco

Differential Revision: D24399514

fbshipit-source-id: f39bb84a1851a4fe4d1f29e6b0961e6a153c943d
2020-10-20 15:19:31 -07:00
Jun Wu
f4e4fb9342 dag: impl DagPersistent for AbstractNameDag
Summary: Implement DagPersistent using the abstracted interface.

Reviewed By: sfilipco

Differential Revision: D24399499

fbshipit-source-id: 3e2c3c776d4ff8d84238a4675d443e36ce212819
2020-10-20 15:19:31 -07:00
Jun Wu
c611f18d28 dag: add 'path' to AbstractNameDag
Summary:
There is a need to open AbstractNameDag cleanly from a path.
Abstract that.

Reviewed By: sfilipco

Differential Revision: D24399498

fbshipit-source-id: ca242cd929e8f5580120c01eeaa928f630c21ed7
2020-10-20 15:19:31 -07:00
Jun Wu
c41904b765 dag: impl DagAlgorithm for AbstractNameDag
Summary:
I copied the code since it's hard to implement using the macros.
In the future I plan to merge MemNameDag into AbstractNameDag
and remove the macros.

Reviewed By: sfilipco

Differential Revision: D24399517

fbshipit-source-id: 326e76cd06a6e1ad26b39bcb51ba0ff24106c984
2020-10-20 15:19:31 -07:00
Jun Wu
1b27600778 dag: impl IdConvert and PrefixLookup for AbstractNameDag
Summary: The `delegate!` is updated to support complex `impl`s.

Reviewed By: sfilipco

Differential Revision: D24399518

fbshipit-source-id: b9ba31174472cce4248e9644611cfc207abc3c1d
2020-10-20 15:19:30 -07:00
Jun Wu
0695b17375 dag: abstract some implementations
Reviewed By: sfilipco

Differential Revision: D24399504

fbshipit-source-id: 388b6788fbe7bbb30a34dcb91b4ca488d49ac8af
2020-10-20 15:19:30 -07:00
Jun Wu
558ed0466f dag: Persist::lock takes &mut self
Summary: It'll satisfy a future change.

Reviewed By: sfilipco

Differential Revision: D24399505

fbshipit-source-id: 6ee2cd0d2b4bd20003082e2733423647cb99619b
2020-10-20 15:19:30 -07:00
Jun Wu
f8e3d67631 dag: add TryClone trait
Summary: Will be used as bounds for abstraction.

Reviewed By: sfilipco

Differential Revision: D24399497

fbshipit-source-id: 343be12237d4850fbde9ebbe4034469527bd77fc
2020-10-20 15:19:30 -07:00
Jun Wu
f04e0fa60e namedag: define an abstract NameDag struct
Summary: It's not yet abstract. But one step closer.

Reviewed By: sfilipco

Differential Revision: D24399510

fbshipit-source-id: 32969733babd41b221170ee440f5d7ced1f7490a
2020-10-20 15:19:30 -07:00
Jun Wu
c49caf64b4 dag: drop snapshot_map from NameDag
Summary: The `snapshot` field can be used instead.

Reviewed By: sfilipco

Differential Revision: D24399507

fbshipit-source-id: 67de20d897b8b763f724f3ccbd46618dec7911b9
2020-10-20 15:19:30 -07:00
Jun Wu
465ac6c5df dag: drop IdMapEq trait
Summary:
The trait requires an `IdMap` snapshot to be locally ready. That's not easy for
all possible implementations. Drop it to simplify things.

Reviewed By: sfilipco

Differential Revision: D24399501

fbshipit-source-id: 4d85f77c99208cda30b2a543a0bb5b295f49a65c
2020-10-20 15:19:30 -07:00
Jun Wu
5f00c7984b dag: unify prepare_filesystem_sync
Summary: There were 2 prepare_filesystem_sync. Unify them into one implementation.

Reviewed By: sfilipco

Differential Revision: D24399513

fbshipit-source-id: 80d009c33b7f23dc2c4225da6fd0fb09589ba061
2020-10-20 15:19:30 -07:00
Jun Wu
4a7ffc4bd7 dag: use Locked for SyncableIdMap
Summary: Simplifies some code.

Reviewed By: sfilipco

Differential Revision: D24399500

fbshipit-source-id: a1317149da066617c4060b7efdae5234e5bd7262
2020-10-20 15:19:30 -07:00
Jun Wu
282c6800cb dag: use Locked for SyncableIdDag
Reviewed By: sfilipco

Differential Revision: D24399506

fbshipit-source-id: 91cfa176b8cfeca3f96dfeb211bf9d46a3d95bd5
2020-10-20 15:19:30 -07:00
Jun Wu
5c7b169e0e dag: add Locked type
Summary: More general purposed type for Syncable{IdDag,IdMap}.

Reviewed By: sfilipco

Differential Revision: D24399502

fbshipit-source-id: 0599db6dd07fe3d430458f86a33a9144d850fca1
2020-10-20 15:19:29 -07:00