Commit Graph

59788 Commits

Author SHA1 Message Date
Durham Goode
311e30746f grep: handle sharded biggrep responses
Summary:
Biggrep recently moved to a sharded system where fbsource is spread
over three shards and can have three different corpus revs. Let's update hg's
biggrep integration to handle this new logic.

We basically just take the earliest corpus commit and diff that against the
users commit.  There's room for some incorrectness here, like if the users
commit is based off a commit before the earliest corpus commit then it will
receive changes from the alter corpus commits. Long term biggrep will work on
unifying the various shards to use a consistent corpus rev, but for now this is
probably acceptable.

Reviewed By: quark-zju

Differential Revision: D23057055

fbshipit-source-id: 745cafe772cea44bbe2d8eb1eee70dd317f255fe
2020-08-13 09:58:52 -07:00
Genevieve Helsel
fdccaae59b add unique return code for unhealthy instance before restart
Reviewed By: xavierd

Differential Revision: D23024654

fbshipit-source-id: c306752219bfe594dc9486d6770f8b7118deb8d5
2020-08-13 09:44:11 -07:00
Stanislau Hlebik
96a9528149 mononoke: use VecDeque in blame_range_split_at
Summary:
We had an accidentally quadratic behaviour in our blame implementation.
blame_range_split_at copied the right part of the range over and over again.
This diff fixes it by using VecDeque instead

Reviewed By: aslpavel

Differential Revision: D23102690

fbshipit-source-id: 951dd6383c48206fdc92757a47690f8e826a737b
2020-08-13 08:32:41 -07:00
Xavier Deguillard
5ef7260cc4 cli: remove the repo on edenfsctl remove
Summary:
On Windows, unmounting the repo isn't sufficient to remove all traces of the
repo as ProjectedFS uses it as a cache, and thus all the files that were
touched by the user are still present on disk after unmounting it.

Reviewed By: wez

Differential Revision: D22915349

fbshipit-source-id: 445379fef57160b5da39a298ca4518e2662d16e3
2020-08-13 08:28:45 -07:00
Xavier Deguillard
e6ddfb4e71 dirstate: do not build the dirfoldmap if _dirs isn't set
Summary:
On EdenFS on Windows (case insensitive), _dirs isn't set, but touching it will
lead to the rest of the dirstate code trying to use it. For instance, removing
a file in the dirstate would try to remove it from _dirs, which would fail as
_dirs is expected to be empty on EdenFS.

Reviewed By: fanzeyi

Differential Revision: D23067897

fbshipit-source-id: 0e0d4aa6457c31d572a2aebc87f0a2fa7215001f
2020-08-13 08:26:16 -07:00
svcscm
a8e3912cdf Updating submodules
Summary:
GitHub commits:

13369bc8d1
24b02f6d64
2e2269e5d1
90b358458c
bd8d3c78d9
df320b4a6c
f458bf8c58
0088daa38e
08d9fd4dac
efc5e2ed7c
392682ba6a

Reviewed By: yns88

fbshipit-source-id: e572c6b73d66c53aea4c62e3297726ec1af745af
2020-08-13 08:26:16 -07:00
svcscm
cb6b96b086 Updating submodules
Summary:
GitHub commits:

a4592a5506
79bd7d493c
646b638b28
56693404c7
938ef7bd4f
a35c52c218
f351dc326e
81eed9f989
ef8e8c4bfc
9840d86715
0d122d6a87
87662614d5

Reviewed By: yns88

fbshipit-source-id: a771d46aa56497b4f54eda94e05b6f7d4423de74
2020-08-13 01:54:19 -07:00
Xavier Deguillard
3d96bdd87a flush stdout before starting a command while interactive
Summary:
Now that the subprocess output is no longer piped, we can see a weird situation
where the command being run is displayed after the compilation step:
  + cd /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/build/eden && \
  [1/13] rust_job_pool
      Finished release [optimized] target(s) in 0.75s
  [12/13] Install the project...
  -- Install configuration: "RelWithDebInfo"
  -- Installing: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/bin/edenfs
  -- Set runtime path of "/data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/bin/edenfs" to ""
  -- Up-to-date: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/bin/edenfsctl
  -- Up-to-date: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/lib/libbackingstore_rs.a
  -- Up-to-date: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/lib/libbackingstore.a
  -- Up-to-date: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/include/eden/scm/lib/backingstore/c_api/HgNativeBackingStore.h
  -- Up-to-date: /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/eden/include/eden/scm/lib/backingstore/c_api/RustBackingStore.h
  + /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/installed/cmake-Ncng4tsJb6gdOu40ggy14-YtgNQD43 (4cb1fa6379)k5ev0n-FXq99I/bin/cmake \
  +      --build \
  +      /data/users/xavierd/scratch/dataZusersZxavierdZfbsource/fbcode_builder_getdeps/build/eden \
  +      --target \
  +      install \
  +      --config \
  +      Release \
  +      -j \
  +      24

This is a bit awkward. Flushing stdout's buffer allows for the ordering to be
correct.

Reviewed By: wez

Differential Revision: D23079405

fbshipit-source-id: e2bf25b098d6ab4a788a5ec07deb635a42cae18c
2020-08-13 01:24:28 -07:00
Viet Hung Nguyen
126a661d8c mononoke/repo_import: add commit push functionality
Summary:
After creating the merge commit (D23028163 (f267bec3f7)) from the imported commit head and the destination bookmark's head, we need to push the commit onto that bookmark. This diff adds the push functionality to repo_import tool.
Note: GlobalrevPushrebaseHook is a hook to assign globalrevs to commits to keep the order of the commits

Reviewed By: StanislavGlebik

Differential Revision: D23072966

fbshipit-source-id: ff815467ed0f96de86da3de9a628fd45743eb167
2020-08-13 00:43:26 -07:00
Jeremy Sze Wei Teo
43425f1116 Revert D22992103: hgcommands: add debugfsync
Differential Revision:
D22992103 (f6d086d13b)

Original commit changeset: b5503e498d52

fbshipit-source-id: ad8f0d9c0bba1d07edb0aebca052da10c0f8e59c
2020-08-12 19:25:24 -07:00
svcscm
5b9d86d6f8 Updating submodules
Summary:
GitHub commits:

f9c00c03aa
1c0d3e42c1
9d6f48ec1d
3355e73a38
48f72258da
c98c8e716e
504b16d454
9a611988e0

Reviewed By: yns88

fbshipit-source-id: 3857f14ca43a47c2dd589b20c15a62a2091f2071
2020-08-12 19:08:29 -07:00
Jun Wu
f6d086d13b hgcommands: add debugfsync
Summary:
The `debugfsync` command calls fsync on newly modified files in svfs.
Right now it only includes locations that we know have constant number
of files.

The fsync logic is put in a separate crate to avoid slow compiles.

Reviewed By: DurhamG

Differential Revision: D22992103

fbshipit-source-id: b5503e498d5216d4ba19701ecd5582387e4f45f5
2020-08-12 18:33:52 -07:00
Jun Wu
3ee967c003 clidispatch: add repo.store_path API
Summary: This allows callsites to get access to the storage.

Reviewed By: DurhamG

Differential Revision: D22992104

fbshipit-source-id: c72fa313be1468170c9728d3856f822bb6385dc8
2020-08-12 18:33:52 -07:00
Jun Wu
8ca7ab1c5a hgcommands: move debug commands to individual files
Summary:
This makes the main command table cleaner.

I dropped the `indexedlogrepair` command as it cannot rebuild indexes. `hg
doctor` is a better replacement. Some debug commands are renamed so they
no longer have `-` in the command name.

Reviewed By: DurhamG

Differential Revision: D22992107

fbshipit-source-id: f65d74e36fb971e592ad0cc8be9a94e245c39662
2020-08-12 18:33:52 -07:00
Jun Wu
bcfa8e5676 hgcommands: move version to a module
Summary: Move some native commands to independent modules.

Reviewed By: DurhamG

Differential Revision: D22992106

fbshipit-source-id: cf7751418d19d54d9dd89d9d0f79851ac11879c3
2020-08-12 18:33:52 -07:00
Jun Wu
8c51e81c97 hgcommands: move root to a module
Summary: Move some native commands to independent modules.

Reviewed By: DurhamG

Differential Revision: D22992105

fbshipit-source-id: e4fd8db3f0d6f9d2ab5be862f6d9469da7d15a93
2020-08-12 18:33:52 -07:00
Jun Wu
896671cefb hgcommands: define a macro to register command from modules
Summary:
If every command lives in their module, then we can define the "module" interface:

- run(...): run the command
- doc(): the help text
- name(): command name, with aliases

Then the macro would make command registration look simpler.

This diff changes `status` to use the pattern as an example.

Reviewed By: DurhamG

Differential Revision: D22992109

fbshipit-source-id: eaf589863092ec2eb1f8c24c1c7e425492fe1e3a
2020-08-12 18:33:52 -07:00
Jun Wu
757daa5eaf hgcommands: move commands to a directory
Summary:
As the number of commands grows, it starts making sense to move them to
individual files. Let's create a directory for them.

Reviewed By: DurhamG

Differential Revision: D22992108

fbshipit-source-id: a0556be602b832579a8e027342d5b86d9d84d257
2020-08-12 18:33:51 -07:00
svcscm
6bc8730737 Updating submodules
Summary:
GitHub commits:

21160e9dc0
698754f355
2bc63e3aba

Reviewed By: yns88

fbshipit-source-id: b99a1caa87a2464957bb3f2e439f84264c812a6e
2020-08-12 17:31:27 -07:00
Xavier Deguillard
2d3370dca4 fsinfo: recognize EdenFS mounts on Windows
Summary:
EdenFS on Windows is a bit weird as ProjectedFS is implemented as a filter
driver that adds reparse point to all the files/directories to get notified of
filesystem operations on them. It then hides these reparse points from the
outside which means that the dwAttributes of a file in EdenFS will not claim
that a reparse point is attached to it. On top of this, newly created
files/directories won't have any reparse points attached to them, until they
start being tracked by EdenFS.

While the first issue can be solved by always querying the reparse tags, I'm
not entirely sure how to solve the second one. That second issue causes
Mercurial to always try to create hardlink in the .hg directory, while it shouldn't.

Reviewed By: DurhamG

Differential Revision: D22937788

fbshipit-source-id: 5d90cd37d40858ed60103ff2d17c2cef16472b38
2020-08-12 15:47:49 -07:00
svcscm
6f480151ae Updating submodules
Summary:
GitHub commits:

fe54c3b607
93bef0fca8
009330b04d
e9ae08b837
75f993e4ac
f314f430c3
b578ca2e4d
203299b2dd
6778303399

Reviewed By: yns88

fbshipit-source-id: ef96d03e22cb1ddfbbc6b6f30d029aace18ee2ca
2020-08-12 14:44:37 -07:00
Stanislau Hlebik
e308419b58 RFC mononoke: limit number of filenodes get_all_filenodes_maybe_stale
Summary:
In a repository with files with large histories we run into a lot of SqlTimeout
errors while fetching file history to serve getpack calls. However fetching the
whole file history is not really necessary - client knows how to work with
partial history i.e. if client misses some portion of history then it would
just fetch it on demand.

This diff adds way to add a limit on how many entries were going to be fetched, and if more entries were fetched then we return FilenodeRangeResult::TooBig. The downside of this diff is that we'd have to do more sequential database
queries.

Reviewed By: krallin

Differential Revision: D23025249

fbshipit-source-id: ebed9d6df6f8f40e658bc4b83123c75f78e70d93
2020-08-12 14:33:43 -07:00
Stanislau Hlebik
5008ac3932 mononoke: start using warm bookmark cache blobimport
Summary: Finally let's start using warm bookmark cache for blobimport

Reviewed By: krallin

Differential Revision: D23057327

fbshipit-source-id: fc454bf827f476919d0bfed7691b8b29d79bd876
2020-08-12 12:03:19 -07:00
Stanislau Hlebik
97041ca4dc sync configerator thrift update
Reviewed By: farnz

Differential Revision: D23057328

fbshipit-source-id: b57fced1a91e47006ca5d44c5bbcebd1a516e7d0
2020-08-12 12:03:18 -07:00
svcscm
89af8a129c Updating submodules
Summary:
GitHub commits:

0ad2a772d7
09a33a579d
8793f93c17
378bc94d7e
fe8f3cbd04

Reviewed By: yns88

fbshipit-source-id: d95681552ec024d85cdd741d1f7f7ffd65d57c29
2020-08-12 12:03:18 -07:00
Stanislau Hlebik
297773719e mononoke: add new warmer that tracks which commit has been blobimported
Summary:
See D23053788 for motivation. Let's add a new warmer that checks
mutable_counters to understand which commit has been imported already.

Reviewed By: krallin

Differential Revision: D23053991

fbshipit-source-id: 3651aed8836a791675dd8d7bcc145fd32e56a13f
2020-08-12 08:50:35 -07:00
Stanislau Hlebik
2767b28825 mononoke: blobimport record highest imported generation number
Reviewed By: krallin

Differential Revision: D23053788

fbshipit-source-id: 615a4f4064a56d6e45818f85f002267d4bf08c95
2020-08-12 08:50:35 -07:00
Xavier Deguillard
e5558221ac store: plumb CMD_CAT_TREE
Summary:
With Mercurial now supporting CMD_CAT_TREE for efficiently fetching and reading
trees, we can plumb this onto EdenFS. At startup time, we detect whether
Mercurial supports CMD_CAT_TREE and use that method, otherwise, we fallback to
the old CMD_FETCH_TREE.

Reviewed By: wez

Differential Revision: D23044953

fbshipit-source-id: 9aea5c5b82e97039a75ef18976a155dcb6e150bc
2020-08-12 08:17:25 -07:00
svcscm
d6e4a8cc20 Updating submodules
Summary:
GitHub commits:

2103933910

Reviewed By: yns88

fbshipit-source-id: db22b79d20303d083af943acfd8d54ac1f4b7a43
2020-08-12 03:44:46 -07:00
Alex Hornby
5631157574 mononoke: use sorted_vector_map when parsing hg manifest blob
Summary:
Use sorted_vector_map when parsing hg manifest blob, as blobs are usually stored sorted, which can result in high cost of BTree insertion when traversing large repos.

Also uses the size_hint() from the parsing Split to save reallocations during insert.

Reviewed By: markbt

Differential Revision: D22975883

fbshipit-source-id: 1faff754f03d7b2c20ebb741fec4f97b310852f9
2020-08-12 02:51:17 -07:00
Xavier Deguillard
7f5439da0e eden: add a cat_tree command
Summary:
When running `edenfsctl prefetch **/BUCK` with an empty hgcache, EdenFS ends up
asking mercurial for every manifest one by one. Unfortunately, every manifest
fetched also causes the packfile to be flushed to disk, which then leads EdenFS
to rescan the filesystem for the new packfile. Once too many packfiles are
present on disk, Mercurial triggers a repack. Effectively, that means we have a
quadratic complexity both on Mercurial, and on EdenFS's side.

While this has been a long standing issue, we've so far avoided falling into
this complexity for a number of reason. The main one being that the hgcache is
very rarely empty, and thus the quadratic complexity is usually on low number
of files. Users also rarely run a prefetch of all the files for the entire
repo. However, on repositories with long standing branches, the hgcache is
effectively cold and thus any prefetch would trigger the pathological behavior.

To solve this, we take the same approach taken for files: sending the raw
manifest to EdenFS, which will then take care of deserializing it properly.

Reviewed By: DurhamG

Differential Revision: D23035335

fbshipit-source-id: 855e6fb4fabf81c427fad6c9f17d05f95c47e9ae
2020-08-12 01:48:03 -07:00
Alex Hornby
7766cac6a1 mononoke: add task spawning to manual_scrub
Summary: Add task spawning to manual_scrub to increase throughput

Reviewed By: farnz

Differential Revision: D23055811

fbshipit-source-id: 1e3d1f0e5b5fc2f2935aa367ae2e749c867d2d62
2020-08-12 01:31:03 -07:00
Alex Hornby
e18cf0210f mononoke: use the background session mode from manual scrub
Summary: There are no users waiting on manual scrub, so set it to use the background session mode.

Reviewed By: krallin

Differential Revision: D23054581

fbshipit-source-id: 985bcadbaf17d2a8c92fdec811ecb239cbca7b37
2020-08-12 01:31:03 -07:00
svcscm
d910adeb21 Updating submodules
Summary:
GitHub commits:

866706a155
4959fb1800

Reviewed By: yns88

fbshipit-source-id: e6c93c77b8f6db6f904ffaee99d9915afbfc7606
2020-08-12 01:31:03 -07:00
svcscm
3d35abe819 Updating submodules
Summary:
GitHub commits:

95022abcd9
efe2962d54

Reviewed By: yns88

fbshipit-source-id: c7abb1851eabfb0d07690e97f00f7bb85aee8078
2020-08-12 00:52:36 -07:00
Xavier Deguillard
5cfd0fd8ba sshpeer: backport connection timeout hotfix
Summary:
On macOS, it appears that ssh has a ~1% chance of never being able to connect
too the server and just hang. This caused mactest to be completely unhealthy
for a couple of days and a similar hotfix was applied to mitigate the issue.

Since it proved to be working, let's now backport this hotfix in the actual
code.

Reviewed By: DurhamG

Differential Revision: D22953230

fbshipit-source-id: ead7662ea6d0a33efaa5c4044c9391b2835ee421
2020-08-11 22:57:20 -07:00
Stefan Filip
e06d9979f5 client: add commit revlog data endpoint
Summary: Client portion for the commit/revlog_data endpoint that was added to the server.

Reviewed By: kulshrax

Differential Revision: D23065989

fbshipit-source-id: 3115ad2b426daca22472e2106fcd293f3ccd70f3
2020-08-11 22:15:10 -07:00
Adam Simpkins
2f55fd2a53 add type annotations to dirstate.py
Summary:
Pyre now has improved support for decorators and descriptors, which makes it
possible for us to add type annotations to `dirstate.py` without needing lots
of `pyre-ignore` comments everywhere.  (Previously Pyre could not handle the
`propertycache` decorator, causing it to be confused about the type of
various dirstate members, like `_map`).

Reviewed By: mrkmndz

Differential Revision: D22969757

fbshipit-source-id: 1b54f1edfb56c20c237a34f14a47404d10605240
2020-08-11 21:45:04 -07:00
Adam Simpkins
0cb0a0bb2a begin adding some type stubs for the Rust Python bindings
Summary: Begin adding some initial type annotations for the Rust Python bindings.

Reviewed By: quark-zju

Differential Revision: D22993222

fbshipit-source-id: 2073db93b22f6bb04e30b767594d435c36ddb17f
2020-08-11 21:45:04 -07:00
svcscm
327e0148f4 Updating submodules
Summary:
GitHub commits:

1175280014
e9daedec84
907906cfa9
c34c520130

Reviewed By: yns88

fbshipit-source-id: 7c5f631d76427d7f0592f10cadc8b9b2cf42879f
2020-08-11 19:28:42 -07:00
Xavier Deguillard
077ba2fd96 cli: properly detect running buck on Windows
Summary:
Using os.kill on EdenFS would always fail and raise an exception. Use the
proc_utils code to detect if the process is running. Also using BUCKVERSION
always raises an error on Windows, so let's ignore that for now.

Reviewed By: fanzeyi

Differential Revision: D22915350

fbshipit-source-id: 806bfab12ae0e8fc97e83d5720481f2a47516129
2020-08-11 19:01:13 -07:00
svcscm
e20e0fb207 Updating submodules
Summary:
GitHub commits:

791119b67b
d11d0b9073

Reviewed By: yns88

fbshipit-source-id: 84be7a3e623c78d14cd64672ee08eab66bda1506
2020-08-11 19:01:13 -07:00
svcscm
22b742ad44 Updating submodules
Summary:
GitHub commits:

1d049ea33c
5bf37a56da
8b65024622
2efcda1389
063cbb129f
57d7da81e4
d8d2db0be6
c043abc5a8

Reviewed By: yns88

fbshipit-source-id: b18767a29034d53a92b6744858d80557bf9b0b80
2020-08-11 17:49:35 -07:00
Stanislau Hlebik
593b16d485 mononoke: add WarmBookmarksCacheBuilder
Summary:
Let's split logic from WarmBookmarksCache into a separate builder. This builder
will configure which warmers we'd like to use.

This will make it easier to introduce a new warmer later in the stack

Reviewed By: krallin

Differential Revision: D23053785

fbshipit-source-id: 32acc9da98d32624ca0dc00277910443f3d86f66
2020-08-11 15:37:36 -07:00
Stanislau Hlebik
8a3d0dca74 mononoke: check if hg changesets should be warmed
Summary:
Previously we were unconditionally adding hg changesets, but that's a bit
strange and there's no reason to do it. Let's do the same check we do for other
derived data types. Note that there should be no change in behaviour - all our
repos have "hgchangesets" derived data type enabled.

Reviewed By: krallin

Differential Revision: D23053786

fbshipit-source-id: 0b3ea99f649bc89ea9b216f368fee11fa25e153f
2020-08-11 15:37:35 -07:00
Stanislau Hlebik
a2d997d7a1 mononoke: renamed is_derived to is_warm
Summary: I want to add a new warmer in the next diffs which won't do any deriving.

Reviewed By: krallin

Differential Revision: D23053787

fbshipit-source-id: 4c7febb60ab7e835302db746c670d656bd9d1989
2020-08-11 15:37:35 -07:00
Xavier Deguillard
ab9cd317da windows: do not remove just created temporary lock files
Summary:
EdenFS may spawn several Mercurial process concurrently and they would all try
to take the wlock at startup time, more often than not, one of these process
would die early due to the tmplock not being present on disk. This is due to
the other Mercurial process removing it, let's have a 10s grace period where
temporary locks aren't removed to avoid this race.

Reviewed By: DurhamG

Differential Revision: D22954997

fbshipit-source-id: ce191265c03a7042d9c6e45db0dc44a688fa204c
2020-08-11 14:48:12 -07:00
svcscm
cf28fa5e01 Updating submodules
Summary:
GitHub commits:

b924a7b1f0
4e81471374
6ac1d25fd0

Reviewed By: yns88

fbshipit-source-id: 8368bb999d6bbc3a624ffc68eed51d489f9ff58e
2020-08-11 14:48:12 -07:00
svcscm
19d4023c01 Updating submodules
Summary:
GitHub commits:

5594a6e41a
e6d5beb44a
cd899e7c3b
1fd960c2f9
7e9865aa3a
5aa5440133
6aac47de5f
7f2e5ff505

Reviewed By: yns88

fbshipit-source-id: 8df15572d09564dbfa2f1e8fba317ff71ad0446a
2020-08-11 12:48:53 -07:00
Tao Chen
dd6d5900f5 Mark getSelection APIs deprecated
Summary: Mark ServiceRouter getSelection APIs deprecated

Differential Revision: D22990911

fbshipit-source-id: b4de95335005f08948796f6017e3317bb1224fd0
2020-08-11 12:34:15 -07:00