Commit Graph

60444 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
5e02a93e91 eden-client: move to use tokio 0.2 socket transport
Summary: No more tokio-core! More `async/await`.

Reviewed By: kulshrax

Differential Revision: D23586509

fbshipit-source-id: b2e766ddb7575bc96963432f0c8582b4370b19aa
2020-09-08 20:24:26 -07:00
Genevieve Helsel
6a9395dff2 fix command line parsing tests on mac
Summary: These are now not working on mac due to the Catalina upgrade, so fixing here to be multi platform compatible by just following our same steps for path resolution.

Reviewed By: wez

Differential Revision: D23582015

fbshipit-source-id: e813986f5523bb721a4f01679559380c2348b98c
2020-09-08 18:43:05 -07:00
Zeyi (Rice) Fan
01315a9bbc fix SpawnedProcess ERROR_BAD_LENGTH
Summary: This fixes the `The program issued a command but the command length is incorrect` error we have been seeing in EdenFS Windows.

Reviewed By: wez

Differential Revision: D23589264

fbshipit-source-id: 72478a653ff07fca81c163bab12c0fd33f6a0a67
2020-09-08 18:25:04 -07:00
Zeyi (Rice) Fan
a6a73ec6b6 switch to tokio 0.2 transport
Summary:
This diff adds a `SocketTransport` implementation that no longer uses legacy `tokio-core` based futures but `tokio-tower` and `tower-service` for processing Thrift requests.

The old implementation is renamed to `SocketTransportLegacy` for better transitioning.

Reviewed By: dtolnay

Differential Revision: D20019196

fbshipit-source-id: 3bee684e9254bf1a81669ef0d2c2262a55e75daa
2020-09-08 17:53:57 -07:00
Zeyi (Rice) Fan
26c8020522 explicitly specify features for tokio-util
Summary: This is needed in a later diff that requires "codec" feature from `future-util`.

Reviewed By: dtolnay

Differential Revision: D23575630

fbshipit-source-id: e9cdf11b6ec05e5f2744da6b6efd8cb7bf08b212
2020-09-08 17:53:56 -07:00
Saurabh Singh
858dbc6861 tests: fix 'test-remotefilelog-undesired-file-logging.t'
Reviewed By: DurhamG

Differential Revision: D23589645

fbshipit-source-id: 350bab980baa811824d7c4fd36d689a5a3395dd8
2020-09-08 17:36:35 -07:00
Xavier Deguillard
1f94f8d652 win: add eden.exe to the package
Summary:
One of the difference between linux/macOS and Windows is that `edenfsctl` needs
to be used while `eden` works on the other platforms. This forces both users to
change their habit, and all the scripts at FB to be changed to take edenfsctl
into consideration.

Reviewed By: chadaustin

Differential Revision: D23550567

fbshipit-source-id: de2b0853137409e595a0012ca9286c37208b98a1
2020-09-08 16:33:55 -07:00
Kostia Balytskyi
39d1cd8a47 synced_commit_mapping: add get which returns a vec
Summary:
This method is a future of synced-commit-mapping: there can be multiple query
results and we should make a decision of whether it is acceptable for the
business logic in the business logic, rather than pick a random one.

In later diffs I will introduce the consumers for this method.

Reviewed By: mitrandir77

Differential Revision: D23574165

fbshipit-source-id: f256f82c9848f54e5096c6e50d42600bfd260081
2020-09-08 13:36:04 -07:00
Kostia Balytskyi
8e2b7754c4 synced_commit_mapping: rename get into get_one
Summary:
Another preparatory step for the actuall mapping model fix. This just renames
`get` method into a `get_one` to emphasize it's use-case and to ease the search later.

At the end of this change, I expect there to be no use-cases for `get_one` and expect is to be gone.

Reviewed By: mitrandir77

Differential Revision: D23574116

fbshipit-source-id: f5015329b15f3f08961006607d0f9bf10f499a88
2020-09-08 13:36:04 -07:00
Kostia Balytskyi
688309059b commit_rewriting: extract existing commit_sync_outcome into a file
Summary: This is just preparatory extraction to make further work more convenient.

Reviewed By: mitrandir77

Differential Revision: D23574077

fbshipit-source-id: 352ca8ac62bae4fd8fcb980da05c95ce477a414e
2020-09-08 13:36:04 -07:00
Durham Goode
2919268555 revisionstore: auto-delete when we have too much pack data
Summary:
In order to keep the hgcache size bounded we need to keep track of pack
file size even during normal operations and delete excess packs.

This has the negative side effect of deleting necessary data if the operation is
legitimately huge, but we'd rather have extra downloading time than fill up the
entire disk.

Reviewed By: quark-zju

Differential Revision: D23486922

fbshipit-source-id: d21be095a8671d2bfc794c85918f796358dc4834
2020-09-08 11:33:50 -07:00
Durham Goode
717d10958f revisionstore: refactor pack iteration code
Summary:
In a future diff we'll add logic to delete old pack files. We'll want
to use this pack iteration code, so let's move it to a function.

Reviewed By: quark-zju

Differential Revision: D23486920

fbshipit-source-id: 5f872e946ffe816289c925dd2e03c292e29da5af
2020-09-08 11:33:50 -07:00
Durham Goode
651a0690be revisionstore: auto-commit datapacks when they get large
Summary:
As the repository grows the opportunity for large downloads increases.
Today all writes to data packs get sent straight to disk, but we have no way to
prevent this from eating all the disk.

Let's automatically flush datapacks when they reach a certain size (default
4GB). In a future diff this will let us automatically garbage collect data packs
to bound the maximum size of packs.

Rotatelog already have this behavior.

Reviewed By: quark-zju

Differential Revision: D23478780

fbshipit-source-id: 14f9f707e8bffc59260c2d04c18b1e4f6bdb2f90
2020-09-08 11:33:50 -07:00
Genevieve Helsel
51c7e04e04 implement get_process_start_time for mac
Summary:
Top of the stack, last process to implement for full implementation on the `edenfs_restarter` code path. Again, we don't have `/proc/pid/stat`, so instead we use datetimes to calculate the start time of the process since epoch in seconds.

Note here that none of these manual runs look at the versions installed/running, and that is because that kind of manual testing only works if I build and manually deploy an rpm.

Reviewed By: fanzeyi

Differential Revision: D23443268

fbshipit-source-id: 370426f2cc0d5209b96615f2c017ac08acf266fc
2020-09-08 11:13:44 -07:00
Genevieve Helsel
e19198ded6 implement get_build_info_from_pid for mac
Summary: Implementation for making a getExportedValues() thrift call to the process if `get_build_info_from_pid()` is unavailable (which is the case on mac).

Reviewed By: fanzeyi

Differential Revision: D23442884

fbshipit-source-id: 011bcb63832226e2dabd5be60dd30e13f2481dcc
2020-09-08 11:13:44 -07:00
Genevieve Helsel
4a900d2df4 implement get_edenfs_processes for mac
Summary: Since mac does not have `/proc/`, instead here we call `ps` commands and parse the output. This mirrors the same logic used up for linux.

Reviewed By: wez

Differential Revision: D23442710

fbshipit-source-id: ed5160e4dd52884e5752949a4fb2077690906ac4
2020-09-08 11:13:44 -07:00
Thomas Orozco
2948993c38 remotefilelog: add killswitch for client certs
Summary:
See D23538897 for context. This adds a killswitch so we can rollout client
certs gradually through dynamicconfig.

Reviewed By: StanislavGlebik

Differential Revision: D23563905

fbshipit-source-id: 52141365d89c3892ad749800db36af08b79c3d0c
2020-09-08 10:39:07 -07:00
Thomas Orozco
d1c4772da3 remotefilelog: use client certs when connecting to LFS
Summary:
Like it says in the title, this updates remotefilelog to present client
certificates when connecting to LFS (this was historically the case in the
previous LFs extension). This has a few upsides:

- It lets us understand who is connecting, which makes debugging easier;
- It lets us enforce ACLs.
- It lets us apply different rate limits to different use cases.

Config-wise, those certs were historically set up for Ovrsource, and the auth
mechanism will ignore them if not found, so this should be safe. That said, I'd
like to a killswitch for this nonetheless. I'll reach out to Durham to see if I
can use dynamic config for that

Also, while I was in there, I cleaned up few functions that were taking
ownership of things but didn't need it.

Reviewed By: DurhamG

Differential Revision: D23538897

fbshipit-source-id: 5658e7ae9f74d385fb134b88d40add0531b6fd10
2020-09-08 10:39:07 -07:00
Wez Furlong
26eb8f0c29 eden: buck kill if appropriate when removing/unmounting a redirect
Summary:
We recently switched fbsource from using `.eden-redirections`
to manage some common buck-out redirections to relying on buck's
`eden redirect add PATH bind` invocation.

As part of this, a few users have run into an issue where buck hasn't
realized that the buck-out directory was unmounted and proceeds to
try to build.  It assumes the `eden redirect add PATH bind` will
restore a missing mount, but that command skips doing any real work
in the case that the mount is configured even if it is unmounted.

This commit aims to improve the UX around this situation by:

* When removing a redirection, test to see if buckd is running for
  the containing path and stop it.
* When running `eden redirect add PATH bind`, if the path is configured
  but not mounted then fixup the mount.  (Previously we'd just print
  that we're skipping it)

Reviewed By: genevievehelsel

Differential Revision: D23502306

fbshipit-source-id: 56e823f0b59981c19d0c44723948bd84d6d9008a
2020-09-08 09:59:16 -07:00
Wez Furlong
2a184e5744 eden: fixup buck kill invocation on macos
Summary:
I ran into a couple of problems with this as part of
looking at some improvements to `eden redirect` later in this
stack:

* There's currently an issue with the BUCKVERSION=last handling
  in our internal version of buck on macos, so sidestep it for now.
* We have a bad interaction between the environment set up to
  run edenfsctl.par and a different par file used by the FB internal
  buck wrapper script that causes it to fail on startup.

This commit cleans up the environment to compensate for these issues.

Reviewed By: genevievehelsel

Differential Revision: D23502307

fbshipit-source-id: 34b5099529dcc5f2b2d638bcb333e4dd00211766
2020-09-08 09:59:15 -07:00
David Tolnay
be0786f14b Prepare for rustfmt 2.0
Summary:
Generated by formatting with rustfmt 2.0.0-rc.2 and then a second time with fbsource's current rustfmt (1.4.14).

This results in formatting for which rustfmt 1.4 is idempotent but is closer to the style of rustfmt 2.0, reducing the amount of code that will need to change atomically in that upgrade.

 ---

*Why now?* **:** The 1.x branch is no longer being developed and fixes like https://github.com/rust-lang/rustfmt/issues/4159 (which we need in fbcode) only land to the 2.0 branch.

 ---

Reviewed By: StanislavGlebik

Differential Revision: D23568780

fbshipit-source-id: b4b4a0aa683d236e2fdeb5b96d723ac2d84b9faf
2020-09-08 07:33:16 -07:00
Stanislau Hlebik
bf8a8c4cc9 mononoke: try to fix the test-redaction.t
Summary:
This test fail on sandcastle because the last two lines are not showing up.
I have a hunch that the last two lines just weren't flushed, and this diff
attempts to fix it.

Reviewed By: krallin

Differential Revision: D23570321

fbshipit-source-id: fd7a3315582c313a05e9f46b404e811384bd2a50
2020-09-08 04:29:33 -07:00
Viet Hung Nguyen
065d80b947 mononoke/repo_import: add small change to sleep time
Summary: When we imported a repo (T71717570), we received a network connect error after querying a lot from graphql.  I am not sure, if it's because of the frequent amount of queries, but just to be on the safe side, I increased the default sleep time between queries.

Reviewed By: krallin

Differential Revision: D23538886

fbshipit-source-id: 6a84f509e5e19f86880d3f8c6413f2f47e4a469b
2020-09-08 01:14:24 -07:00
David Tolnay
e62b176170 Prepare for rustfmt 2.0
Summary:
Generated by formatting with rustfmt 2.0.0-rc.2 and then a second time with fbsource's current rustfmt (1.4.14).

This results in formatting for which rustfmt 1.4 is idempotent but is closer to the style of rustfmt 2.0, reducing the amount of code that will need to change atomically in that upgrade.

 ---

*Why now?* **:** The 1.x branch is no longer being developed and fixes like https://github.com/rust-lang/rustfmt/issues/4159 (which we need in fbcode) only land to the 2.0 branch.

 ---

Reviewed By: zertosh

Differential Revision: D23568779

fbshipit-source-id: 477200f35b280a4f6471d8e574e37e5f57917baf
2020-09-07 20:47:59 -07:00
Arun Kulshreshtha
8a26c3c960 edenapi_server: add Scuba logging
Summary: Add Scuba logging using `ScubaMiddleware` from `gotham_ext`. Each request will be logged to the Scuba dataset specified by the `--scuba-dataset` flag, as well as optionally to the log file specified by `--scuba-log-file`.

Reviewed By: sfilipco

Differential Revision: D23547668

fbshipit-source-id: e6cd88ad729a40cf45b63538f7481ee098ea12dc
2020-09-07 17:24:45 -07:00
Arun Kulshreshtha
a7a96e55eb lfs_server: tidy up middleware imports
Summary: Import middleware directly from `gotham_ext` rather than relying on reexports in the `middleware` module.

Reviewed By: farnz

Differential Revision: D23547320

fbshipit-source-id: e64a8acff55445a646b0a1b3b1e71cf6606c3d02
2020-09-07 17:24:45 -07:00
Arun Kulshreshtha
83c54b48f8 gotham_ext: move ScubaMiddleware into gotham_ext
Summary:
Move `ScubaMiddleware` out of the LFS server and into `gotham_ext`.

This change required splitting up the `ScubaKey` enum to separate generally useful column names (e.g., HTTP columns that would be applicable to any HTTP service) from LFS-specific columns. `ScubaMiddlwareState` has been modified to accept any type that implements `Into<String>` as a key, and the `ScubaKey` enum has been split up into `HttpScubaKey` (in `gotham_ext`) and `LfsScubaKey` (in `lfs_server`).

The middleware now takes a type parameter to specify a "handler" (implementing the new `ScubaHandler`  trait) which allows the application to add application-specific Scuba columns in addition to the default columns. The application-specific columns will be added immediately prior to the sample being logged.

Reviewed By: krallin

Differential Revision: D23458748

fbshipit-source-id: 3e99f3e0b5d3475a4f5ac9eaefade2eeff12c2fa
2020-09-07 17:24:45 -07:00
Mateusz Kwapich
6e5a6c3d71 metaedit: JSON input mode
Summary:
This makes it easy for `metaedit` to be used by automation. Provided
with a simple JSON file with hash->{user, message} mapping metaedit will
do all of its work without any prompts.

Reviewed By: quark-zju

Differential Revision: D23545527

fbshipit-source-id: 18763ecacff9143b9ad492faf654b176b0f86d1f
2020-09-07 13:33:58 -07:00
Mateusz Kwapich
3c10f1b9c5 add a way to query changed directories
Summary:
This diff is more complex than I wished for it as originally I didn't take into
account direcotries when designing `commit_compare` method.

Reviewed By: StanislavGlebik

Differential Revision: D23541892

fbshipit-source-id: 0e2b2abf7b3c541529d9881e48a575239374040f
2020-09-07 11:58:31 -07:00
Mateusz Kwapich
49b98e206e add a way to diff the directories between commits
Summary: We need that to replace similar feature in SCMQuery

Reviewed By: StanislavGlebik

Differential Revision: D23541893

fbshipit-source-id: 3dd6357ea834337a81216e24cb132e23b01bc77d
2020-09-07 11:58:31 -07:00
Lukas Piatkowski
fbfb856191 mononoke/integration test: make test-traffic-replay.t private
Reviewed By: StanislavGlebik

Differential Revision: D23565712

fbshipit-source-id: 7cb2d4a6c107ff513522e7343ffd5a8eea25879c
2020-09-07 10:35:39 -07:00
Lukasz Piatkowski
52bc18a728 mononoke/integration tests: fix up integration tests using hooks (#48)
Summary:
Hooks have been recently made public. Remove from list of excluded tests the ones that were blocked by missing hooks and fix them up.

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/48

Reviewed By: farnz

Differential Revision: D23564883

Pulled By: lukaspiatkowski

fbshipit-source-id: 101dd093eb11003b8a4b4aa4c5ce242d9a9b9462
2020-09-07 08:42:39 -07:00
Jun Wu
89eb6520d2 scmutil: remove meaningfulparents
Summary:
The "meaningfulparents" concept is coupled with rev numbers.
Remove it. This changes default templates to not show parents, and `{parents}`
template to show parents.

Reviewed By: DurhamG

Differential Revision: D23408970

fbshipit-source-id: f1a8060122ee6655d9f64147b35a321af839266e
2020-09-05 15:06:44 -07:00
Lukasz Piatkowski
20b082ee6a mononoke/integration tests: blacklist 2 integration tests on OSS runs (#47)
Summary:
Those are new tests that use functionality not compatible yet with OSS.

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/47

Reviewed By: chadaustin

Differential Revision: D23538921

Pulled By: lukaspiatkowski

fbshipit-source-id: c512a1b2359f9ff772d0e66d2e6a66f91e00f95c
2020-09-04 20:21:56 -07:00
svcscm
aa5f469182 Updating submodules
Summary:
GitHub commits:

82fd90abf0

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 16506a28e9582bfe74e0a41cb1898ed1427d4362
2020-09-04 20:21:55 -07:00
svcscm
100cd000da Updating submodules
Summary:
GitHub commits:

bf79a4a008
2a6bb41695
cc187366c1
d4b82f07f9
519a28832e
f9b71cd22c
c7034d3dd0
6f804604df
0cd07a85f4
74a0846773
c44a418ede

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: cdc4551e048048eda7fbeac0c7452e2979c1e391
2020-09-04 18:57:58 -07:00
Xavier Deguillard
cd0af7689a utils: compile ProcessAccessLog and ProcessNameCache on Windows
Summary:
Even though these might not be fully ported on Windows, they do compile and
tests are passing, so let's compile them.

Reviewed By: chadaustin

Differential Revision: D23505509

fbshipit-source-id: 567e8668ca489daf89c1c6576973bbaaabbb6c88
2020-09-04 16:14:25 -07:00
Xavier Deguillard
a5c85ec822 fuse: move and rename RequestData
Summary:
Most of the RequestData code is platform generic, but bits of it are currently
strongly tied to FUSE. By splitting these 2 parts, we will be able to use the
RequestContext class in Windows too and not having to re-implement all the
logic there.

Reviewed By: chadaustin

Differential Revision: D23482072

fbshipit-source-id: 857fd9ca4264d0f308ec10cc487e9ff3eeb5ee16
2020-09-04 16:14:24 -07:00
svcscm
549aa887de Updating submodules
Summary:
GitHub commits:

7af96e7f00
fef268ac15
f547036eb0
756005873e
ef32f11004
84012d3044
7e401c095f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 957b31b3d439265c1d44923fa9ededb70f07fd4a
2020-09-04 15:48:08 -07:00
Durham Goode
8b91cccc8b remotefilelog: log undesired filename fetches
Summary:
Now that the Rust revisionstore records undesired filename fetches,
let's log those results to Scuba in Python.

Reviewed By: StanislavGlebik

Differential Revision: D23462572

fbshipit-source-id: b55f2290e30e3a5c3b67d9f612b24bc3aad403a8
2020-09-04 14:55:15 -07:00
Durham Goode
9772ab1718 revisionstore: record remote fetches that match a pattern
Summary:
We want to be able to record when fetches to certain paths happen.
Let's add recording infrastructure to the new ReportingRemoteDataStore.

A future diff will make the seen accessible from Python for scuba logging.

Reviewed By: xavierd

Differential Revision: D23462574

fbshipit-source-id: 5d749f2429e26e8e7fe4fb5adc29140b4309eac9
2020-09-04 14:55:15 -07:00
Durham Goode
84cbc26b1e revisionstore: add reporting wrapper for remote data store
Summary:
We want to monitor what paths are fetched from our remote servers.
Since all of our remote stores are hidden behind the RemoteDataStore interface,
let's create a wrapper around that. A future diff will insert the actual
monitoring and reporting.

Reviewed By: quark-zju

Differential Revision: D23462571

fbshipit-source-id: e6031f19db23f7d1b09767efb9613d7528fb457d
2020-09-04 14:55:14 -07:00
Jun Wu
dabb68c1e5 checkmessagehook: make error message more obvious
Summary: This hopefully makes it more obvious so it looks less like an hg crash.

Reviewed By: kulshrax

Differential Revision: D23509569

fbshipit-source-id: 7174780bc7e9841e3f89a482280c49427b62fb74
2020-09-04 14:55:14 -07:00
Jun Wu
4131dcf012 context: avoid memorizing revs
Summary:
The revs can change after flush. For example, during pushrebase, some ctx might
initially have a non-master Id assigned, and later got assigned an Id in the
master group:

```
ipdb> p self.__dict__
{'_repo': <edenscm.hgext.fastannotate.protocol.localreposetup.<locals>.fastannotaterepo object at 0x7f2415b3f8e0>, '_rev': 72057594038527478, '_node': b'\xb6\x12\xcd\x81b#\xa3\x01\xe2pP\x84\x05{\xd2He\xbe\xcc\xf0'}
ipdb> p self._node
b'\xb6\x12\xcd\x81b#\xa3\x01\xe2pP\x84\x05{\xd2He\xbe\xcc\xf0'
ipdb> p self._repo.changelog.rev(self._node)
7198913
ipdb> p self._rev
72057594038527478
```

Note that `self._rev` becomes inconsistent with `changelog.rev(self._node)`.

The error looks like:

  $ hg push -r . --to master --debug --trace --traceback --verbose
  ...
  pushing rev 556400239977 to destination ...
  ...
  1 commits found
  list of changesets:
  556400239977b9ed523eae5ad28773784c975f7f
  sending unbundle command
  ...
  added 79 commits with 0 changes to 0 files
  moving remote bookmark 'remote/master' to 84829e9242e4
  ...
  using eden update code path
  Traceback (most recent call last):
    ...
    File "/opt/fb/mercurial/edenscm/mercurial/merge.py", line 2220, in update
      return eden_update.update(
    File "/opt/fb/mercurial/edenscm/mercurial/eden_update.py", line 126, in update
      stats, actions = _handle_update_conflicts(
    ...
    File "/opt/fb/mercurial/edenscm/mercurial/context.py", line 503, in _changeset
      return self._repo.changelog.changelogrevision(self.rev())
      # self = <changectx 84829e9242e4>
    File "/opt/fb/mercurial/edenscm/mercurial/changelog2.py", line 312, in changelogrevision
      return changelogrevision(self.revision(nodeorrev))
      # nodeorrev = 72057594038527521
    File "/opt/fb/mercurial/edenscm/mercurial/changelog2.py", line 365, in revision
      node = self.node(nodeorrev)
      # nodeorrev = 72057594038527521
    File "/opt/fb/mercurial/edenscm/mercurial/changelog2.py", line 280, in node
      raise IndexError("revlog index out of range")
  Traceback (most recent call last):
    File "/opt/fb/mercurial/edenscm/mercurial/changelog2.py", line 278, in node
      return self.idmap.id2node(rev)
  error.CommitLookupError: 'N599585 cannot be found'

Change `context` object to not memorizing revs.

Reviewed By: DurhamG

Differential Revision: D23468702

fbshipit-source-id: b623bcec99b09d61169371e08c69fc6d6f38935c
2020-09-04 13:22:18 -07:00
Lukas Piatkowski
12c684afcd mononoke/hooks: make deny_files public
Reviewed By: aslpavel

Differential Revision: D23537799

fbshipit-source-id: 58c9568e30982f682b00faae42bc3a3f3595890f
2020-09-04 12:23:35 -07:00
Jun Wu
e74133f0fa dag: limit max segment level to 4
Summary:
This is based on fbsource data, building level 5 proves to be not useful.

This would save 300ms in the write path.

Reviewed By: sfilipco

Differential Revision: D23494505

fbshipit-source-id: ca795b4900af40dbfdaa463d36f3169413bf6a62
2020-09-04 12:20:54 -07:00
Jun Wu
b4adf0602f dag: remove non-master "Name -> Id" index on request
Summary:
Previously the IdMap's "Name -> Id" index simply ignores the "reassign
non-master" request. It turns out stale entries in that index can cause
issues as demonstrated by the previous diff.

Update IdMap to actually remove both indexes of non-master group on
remove_non_master so it cannot have stale entries.

To optimize the index, the format of IdMap is changed from:

  [ 8 bytes Id (Big Endian) ] [ Name ]

to:

  [ 8 bytes Id (Big Endian) ] [ 1 byte Group ] [ Name ]

So the index can use reference to the slice, instead of embedding the bytes, to
reduce index size.

The filesystem directory name for IdMap used by NameDag is bumped to `idmap2`
so it won't read the incompatible old `idmap` data.

Reviewed By: sfilipco

Differential Revision: D23494508

fbshipit-source-id: 3cb7782577750ba5bd13515b370f787519ed3894
2020-09-04 12:20:53 -07:00
Jun Wu
c5d6c9d0f2 dag: add a test showing non-master rebuild issues
Summary: Some vertexes can disappear from the graph!

Reviewed By: sfilipco

Differential Revision: D23494506

fbshipit-source-id: ecbf2a4169e5fc82596e89a4bfe4c442a82e9cd2
2020-09-04 12:20:53 -07:00
Jun Wu
4aea3657e1 dag: move some test utilities to a TestDag struct
Summary: The TestDag struct will be used to do some more complicated tests.

Reviewed By: sfilipco

Differential Revision: D23494507

fbshipit-source-id: 11350f9e448725ae49f50a7b6f19efc57ad84448
2020-09-04 12:20:53 -07:00
Thomas Orozco
3ba2c2b429 mononoke/hg_sync: make it work on Mercurial Python 3
Summary:
A few things here:

- The heads must be bytes.
- The arguments to wireproto must be strings (we used to encode / decode them,
  but we shouldn't).
- The bookmark must be a string (otherwise it gets serialized as `"b\"foo\""`
  and then it deserializes to that instead of `foo`).

Reviewed By: StanislavGlebik

Differential Revision: D23499846

fbshipit-source-id: c8a657f24c161080c2d829eb214d17bc1c3d13ef
2020-09-04 11:56:44 -07:00