Commit Graph

58424 Commits

Author SHA1 Message Date
Jun Wu
33b497c035 remotefilelog: fix type of missingids
Summary: `getpack` requires list and will crash on set.

Reviewed By: xavierd

Differential Revision: D21968128

fbshipit-source-id: 75956f5adfcdb8082608e65f041007e58fc36c5c
2020-06-10 19:29:50 -07:00
Xavier Deguillard
4b8809c786 win: handle moving files in and out of the repo
Summary:
The documentation for PRJ_NOTIFICATION_FILE_RENAMED points out that the
filenames can be empty strings to represent files moved to and from the
repository itself. By not special casing this we were trying to create and/or
remove an empty file at the root of the repo which would lead to an overlay
corruption.

Reviewed By: genevievehelsel

Differential Revision: D21961579

fbshipit-source-id: fbfd872ca0377cb90224eba5505ff406812d51a7
2020-06-10 19:29:50 -07:00
Xavier Deguillard
e05de75a3f revlogindex: revert "do not use mmap to read .i on Windows"
Summary:
Reading the 00changelog.i entirely can be very expensive both in time and
memory. Since the 00changelog.i is now copied, then truncated and copied back
in place, we no longer have the limitation that prevents Windows from using
mmap for it, so let's do it.

Reviewed By: quark-zju

Differential Revision: D21968805

fbshipit-source-id: c0d19593e1f565c93b9243a63c87d03cfbc821d8
2020-06-10 19:29:50 -07:00
svcscm
1d4f72d8c8 Updating submodules
Summary:
GitHub commits:

331535f203
8d424c5404
9385c34221
eedd8e678d
d645862871
9fb396c554

Reviewed By: jurajh-fb

fbshipit-source-id: c766acaec4cdceb997e4ae05827527eab4bd439f
2020-06-10 19:29:49 -07:00
David Tolnay
5609aa9509 cargo_from_buck: Hide generated code from rustfmt
Differential Revision: D21966217

fbshipit-source-id: f540a2e233cc2645ae71df5134b1a810d4425053
2020-06-10 19:29:49 -07:00
Ailin Zhang
1b159d58b9 fix __isset deprecated problem
Summary: This diff fixes `'__isset' is deprecated` problem when building `//eden/fs/service:edenfs`

Reviewed By: simpkins

Differential Revision: D21966922

fbshipit-source-id: c3b12134f3f84db0a97f3975dae5d64a2c98641a
2020-06-10 19:29:49 -07:00
Aida Getoeva
81e7b76475 mononoke/apiserver: remove content sha1 cache
Summary: It was used by APIServer only, now when it's decomissioned we can delete this.

Reviewed By: HarveyHunt

Differential Revision: D21954670

fbshipit-source-id: a16bbbbb9dfe17eda5ff1ee6267251708ee4d562
2020-06-10 19:29:48 -07:00
Durham Goode
9473b487b5 tests: enable treemanifest for ~100 more tests
Summary:
Enables treemanifest for about 100 more tests. To make them pass I had
to expose the gettreepack capability from peers, which just works, and enable
treeonly and sendtrees by default in the tests, which I probably should've done
before anyway.

Reviewed By: quark-zju

Differential Revision: D21894955

fbshipit-source-id: 7a6a4d453824fb8c81a797a5487bf2ecc2b67761
2020-06-10 19:29:48 -07:00
Aida Getoeva
4776c29077 mononoke/fastlog: clean up ops module
Summary: This diff resolves TODO to make a helper function a crate private function as the only dependency (APIServer) is now gone.

Reviewed By: StanislavGlebik

Differential Revision: D21954238

fbshipit-source-id: 7cfc49534b7ab8af6035f7a87fdc763127dce318
2020-06-10 19:29:48 -07:00
Aida Getoeva
11c4601550 mononoke: remove apiserver source code
Summary:
APIServer is deprecated, tw jobs stopped and deleted.
This diffs removes the source code.

Reviewed By: krallin

Differential Revision: D21839442

fbshipit-source-id: 5a4089d9205d8b0061c8aa01dcd74674fe9baca8
2020-06-10 19:29:47 -07:00
svcscm
ddf450e9a7 Updating submodules
Summary:
GitHub commits:

de41f58aaa
aa1b6eb533
263f93f432
e7fcd11721
639938b925
77fb3bc40c

Reviewed By: jurajh-fb

fbshipit-source-id: 03db857a72e244e00ed3e591a5fccff2b96c8e55
2020-06-10 19:29:47 -07:00
Egor Tkachenko
d72c2b0b60 mononoke: opsfiles: Port deny_from_corp.sh hook
Summary: Ported deny_from_corp hook into mononoke.

Reviewed By: krallin

Differential Revision: D21329467

fbshipit-source-id: f5fa7a745b09a83b2624dd074155901f0bd31a55
2020-06-10 19:29:47 -07:00
svcscm
1f8cc4977d Updating submodules
Summary:
GitHub commits:

b767869eff
f3e4e9df4c
09357e1dd3
dc2ef325b5

Reviewed By: jurajh-fb

fbshipit-source-id: e23f736d7bf7af09d85b3a805754c855e319c762
2020-06-10 19:29:46 -07:00
svcscm
5d45a63cf3 Updating submodules
Summary:
GitHub commits:

0c4856b070
cb47018e71
3b500da5b4
367b2efbba
02db03af8d
ea6aa14363
dbda10691f
8e80fb3065
d9abd307c5
f4856eb824

Reviewed By: jurajh-fb

fbshipit-source-id: 7a86fbc7bc52e924aaf4b3af218abecbcdefa21b
2020-06-10 19:29:46 -07:00
Xavier Deguillard
edd44536ae transaction: copy files before truncation
Summary:
On Windows, if a file is memory mapped it cannot be truncated, unfortunately,
with the 00changelog.i being almost 500MB, this means that every time Mercurial
starts, the file needs to be read entirely. With the code being moved to Rust,
this read is done twice, resulting in a memory consumption of over 900MB.

Instead of always trying truncate the file in place, let's just try to truncate
it first, and then copy it, truncate it and then move it back in place. This
will allow us to memory map the 00changelog.i on Windows, which should
significantly reduce the memory consumption of Mercurial.

Reviewed By: DurhamG

Differential Revision: D21953553

fbshipit-source-id: e0f447fea017a34c8da8cdbbc6914cee7b5b2bee
2020-06-10 19:29:45 -07:00
Durham Goode
6f7b096d91 treemanifest: override root node during normal hg push
Summary:
We need to support pushing legacy flat manifets commits without push
rebase. Currently we rebuild the tree on the server and recompute it's hash,
which can result in a tree hash instead of a flat hash for the pushed commit.
Since we're provided with the correct hash via the push, we should just use that
directly.

Since the hash isn't validated, it opens some opportunities for receiving
incorrect data from the server, but we can disable this functionality at some
point, once all legacy repos have been merged in.  Then we can get rid of the
need for flat manifest hashes entirely once we switch to a new hash scheme.

Reviewed By: quark-zju

Differential Revision: D21962513

fbshipit-source-id: 8cdaf3a4e2aba73d5fc97fcb78821d2c88f5284f
2020-06-10 19:29:45 -07:00
Arun Kulshreshtha
9c689337cd edenapi_types: rename depth to length in history request
Summary: D21880220 renamed the `depth` parameter in Mononoke's history fetching functions to be `length`. This diff makes the same change for EdenAPI's `HistoryRequest` struct.

Reviewed By: StanislavGlebik

Differential Revision: D21948599

fbshipit-source-id: fe8649a5789f07d8262ad3d5e2f477a8b50f2c6f
2020-06-10 19:29:45 -07:00
Arun Kulshreshtha
898ddfe519 edenapi_server: add subtree endpoint
Summary:
Add a new `subtree` endpoint to the EdenAPI server, which fetches trees using the underlying server-side logic for the `gettreepack` wire protocol command. This is intended for use in situations where compatibility with `gettreepack` is desired when using HTTP for tree fetching.

The name of the endpoint is up for bikeshedding. It seemed weird to name the endpoint `gettreepack` since that name is a verb and refers to a "pack" which is not relevant in this context (there are no wirepacks or packfiles involved). I chose the name `subtree` since the endpoint logically returns all of the nodes underneath a given node in the tree (though in the most frequent case, the node will be the root node and therefore the subtree will be the entire tree).

In practice, this initial implementation is not ideal because it buffers the trees in memory, which is problematic because `gettreepack` requests are likely to produce a very large number of trees. Later in this stack, the endpoint will be updated to produce a streaming response instead.

Reviewed By: StanislavGlebik

Differential Revision: D21782764

fbshipit-source-id: 726925858352c33c923da1979da9d20fbcf930f6
2020-06-10 19:29:44 -07:00
Arun Kulshreshtha
cde0436ca9 edenapi_types: move EdenAPI types into separate crate
Summary:
Several of the structs used by EdenAPI were previously defined in Mercurial's
`types` crate. This is not ideal since these structs are used for data interchange
between the client and server, and changes to them can break Mononoke, Mercurial,
or both. As such, they are more fragile than other types and their use should be
limited to the EdenAPI server and client to avoid the need for extensive breaking
changes or costly refactors down the line.

I'm about to make a series of breaking changes to these types as part of the
migration to the new EdenAPI server, so this seemed like an ideal time to split
these types into their own crate.

Reviewed By: krallin

Differential Revision: D21857425

fbshipit-source-id: 82dedc4a2d597532e58072267d8a3368c3d5c9e7
2020-06-10 19:29:44 -07:00
Simon Farnsworth
335f5d6ebc Move sqlblob tests into a separate module.
Summary: There's over 150 lines of code here, or around 1/3rd of lib.rs. Move to a separate module, so that growth of tests won't make lib.rs too long

Reviewed By: ahornby

Differential Revision: D21952798

fbshipit-source-id: 4e4edf4fde5a6626e2c33c8ea30ec85e6f3c6bf1
2020-06-10 19:29:44 -07:00
Simon Farnsworth
2d8f526e96 Make the sqlblob tests actually use async/await
Summary: These were minimal conversions of old-style tests - use `.compat()` so that we have "true" async tests.

Reviewed By: ahornby

Differential Revision: D21950533

fbshipit-source-id: 71608201c4fe475d07b9ff3fafa138036f3dad5b
2020-06-10 19:29:43 -07:00
Simon Farnsworth
41451e31ce Always chunk sqlblob data for dedup
Summary: We used to inline smaller blobs into the data table, and only chunk bigger blobs. Performance tests show that we don't have significant issues with round trips to our MySQL infrastructure, so let's simplify the problems of deduplication and hard linking by always storing the data in chunks, and having the keys directly return significant data.

Reviewed By: ahornby

Differential Revision: D21939500

fbshipit-source-id: 6ad73b25ac859fb1b4f067a3016516b713e8b2f5
2020-06-10 19:29:43 -07:00
Yedidya Feldblum
eaa582d1be Cut FOR_EACH_KV
Summary: [Folly] Cut the FOR_EACH_KV macro, which may be replaced by a combination of range-for and structured bindings.

Differential Revision: D21826182

fbshipit-source-id: ce4712afd3d0d7806eb1fca8c97009da117f982e
2020-06-10 19:29:43 -07:00
Carolyn Busch
9bd69cbb3a enable passing py3 tests
Summary: Enable all disabled py3 tests that are passing.

Reviewed By: xavierd

Differential Revision: D21896122

fbshipit-source-id: 35b8dd6bb7a1b9f2d002f1b021989f642ed790ec
2020-06-10 19:29:42 -07:00
Chad Austin
e1e4bdee40 add a (failing) test of binary blob contents over thrift
Summary:
Add a disabled test that illustrates that binary data fails to
serialize between edenfs and the CLI with the current Thrift
implementation.

Reviewed By: fanzeyi

Differential Revision: D21890379

fbshipit-source-id: 725e99751e1d62c39f4059ec0f1197857c47e3b4
2020-06-10 19:29:42 -07:00
Chad Austin
7e4835f677 rename eden.thrift Python module to eden.thrift.legacy
Summary:
The Python 2-and-3 Thrift API is sort of deprecated and does not
handle binary data in `binary` fields. In advance of migrating to the
modern Python 3 API, remane eden.thrift to eden.thrift.legacy.

Reviewed By: fanzeyi

Differential Revision: D21889697

fbshipit-source-id: a745ee8977999acbfb383a4edebe81d8deb1734e
2020-06-10 19:29:42 -07:00
svcscm
18e40104ab Updating submodules
Summary:
GitHub commits:

0e3a668133
48bc869105
76ba034697

Reviewed By: jurajh-fb

fbshipit-source-id: d8cec895dcafd3a39b50226c19f470c76d701849
2020-06-10 19:29:41 -07:00
Kostia Balytskyi
dc91c602d1 infinitepush: support setting a reason for disabling writes
Reviewed By: StanislavGlebik

Differential Revision: D21929217

fbshipit-source-id: 5924a29945da4b4bb4bbf6f8e93f427d66665900
2020-06-10 19:29:41 -07:00
Alex Hornby
0c1ccb601a mononoke: blobstore_sync_queue: switch to insert rather than insert ignore
Summary: Now that the blobstore_sync_queue has no unique key we do not expect duplicate key errors,  and would like to know of any other problems occuring on insert.

Reviewed By: StanislavGlebik

Differential Revision: D21618062

fbshipit-source-id: 85991184234a807553388b456ad76971104000a3
2020-06-10 19:29:41 -07:00
svcscm
1f662ee2e4 Updating submodules
Summary:
GitHub commits:

e223d1a493

Reviewed By: jurajh-fb

fbshipit-source-id: a60058a671c13496cb0c772ebcf10626eacb4c92
2020-06-10 19:29:40 -07:00
Durham Goode
55ba025a8e tests: fix test-deprecate.t
Summary: I made a change before landing my last diff and didn't retest.

Reviewed By: xavierd

Differential Revision: D21944268

fbshipit-source-id: a5c820cef5b0fc019c7be5d096db9d0e7b3e5a44
2020-06-10 19:29:40 -07:00
svcscm
6361cf93c5 Updating submodules
Summary:
GitHub commits:

84c22f0cff
ce6ba0647c
6a8ddd374d
be219f7837
75287f440e
7707073773
9622b0db26
d685ec45f7

Reviewed By: jurajh-fb

fbshipit-source-id: 452364c8e854e8f35536434b47677d526bde71a1
2020-06-10 19:29:40 -07:00
Meyer Jacobs
96ef9dda5d debug: Add commit metadata storage and templating for marking stable commits
Summary:
Introduced a new local commit metadata storage system, smallcommitmetadata, which stores a simple local JSON file for a mapping of (node, category) -> value.

This data can be manipulated with the debugsmallcommitmetadata command, and can be consumed in the smartlog using the smallcommitmeta template func.

Total number of entries can be limited with smallcommitmetadata.entrylimit configuration option, which defaults to 100.

Reviewed By: DurhamG

Differential Revision: D21673611

fbshipit-source-id: 2239a47867118dd86b15944058505ddf67548549
2020-06-10 19:29:39 -07:00
Durham Goode
bc9087841c deprecate: log the caller of the deprecated logic
Summary:
Let's record the caller of the hg command that's using deprecated
logic. In most cases the caller will be the unix username, but we'd like to get
services to set an environment variable with their oncall so we could associate
hg usage with specific oncalls and eventually automatically file tasks for using
deprecated functionality.

Reviewed By: markbt

Differential Revision: D21891753

fbshipit-source-id: a4de0d348c583777cc3eeb9be26510e6af8b3a27
2020-06-10 19:29:39 -07:00
Durham Goode
b0aba2856f deprecate: deprecate a number of commands
Summary:
Marks a number of commands as deprecated. The default ui.deprecate()
behavior is to just log the usage to scuba, so this diff doesn't actually change
any behavior.

Reviewed By: markbt

Differential Revision: D21891192

fbshipit-source-id: 4611e31cf630eee4f07443fe242c759c3cb3fe31
2020-06-10 19:29:38 -07:00
Durham Goode
1d65457032 deprecate: introduce ui.deprecate
Summary:
Adds a simple ui.deprecate() function for deprecating code paths. It
has several levels of deprecation and can optionally automatically escalate
through those levels across a specified time frame.

The levels are:
- Log - just logs the usage to scuba
- Warn - same as Log but also prints a warning to the user
- Slow - same as Warn but also sleeps for 2 seconds
- OptIn - throws an exception, but hints that the exception can be bypassed by
  setting 'deprecated.bypass-XXXX=True'
- Block - throws an exception that cannot be bypassed

I also call it from a few locations that are expected to be deprecated already.

Reviewed By: markbt

Differential Revision: D21890496

fbshipit-source-id: faddb301888ef75cc71d46ffb7374f3fe3d044bd
2020-06-10 19:29:38 -07:00
Sandeep Kumar Pani
e28bde4df3 Make tests also use TPX in the env
Differential Revision: D21935706

fbshipit-source-id: 411277be2f8e8666569621de70eff50276897337
2020-06-10 19:29:38 -07:00
Jun Wu
d1bc8e37f9 tests: remove helpers-usechg.t
Summary:
`chg` is now integrated as `#chg-compatible` by the test framework. The helper
script no longer works.

Reviewed By: markbt

Differential Revision: D21895009

fbshipit-source-id: 257ed081fbd1a6acc97afbfa2934134e389ab400
2020-06-10 19:29:37 -07:00
Jun Wu
69b33a286f tests: enable visibility for more tests
Summary: Real strip no longer happens.  Revision numbers are changed.

Reviewed By: markbt

Differential Revision: D21894317

fbshipit-source-id: cc335eb9fdbe99c4b7975fead825400474ea1016
2020-06-10 19:29:37 -07:00
Jun Wu
5bbee8b52d test-hook: enable visibility
Summary:
This requires `--hidden` for `hg tip` to show the pending commits in hooks.
The real fix would be handling pending visibility changes in metalog layer.

Reviewed By: markbt

Differential Revision: D21894321

fbshipit-source-id: 3b2296c9c38b37aee2c57eea0ad03c3acaab7507
2020-06-10 19:29:37 -07:00
Jun Wu
811aea8aae test-obsmarker-template: remove the test
Summary:
The test depends on lots of implementation details of obsmakers (ex. prune
markers, etc). In production we use mutation templates tested by
test-mutation.t. Therefore remove the test.

Reviewed By: markbt

Differential Revision: D21894319

fbshipit-source-id: 549423b1f5f45cf567b3c95e5fe3ccfa30b6695a
2020-06-10 19:29:36 -07:00
Xavier Deguillard
8822c2bfaf prjfsChannel: do not store the mount path
Summary:
The mount path is required in 2 places: at mount time, and when deleting files.
It turns out that the second one doesn't require it as PrjDeleteFile specify
the filename to be: "A null-terminated Unicode string specifying the path,
relative to the virtualization root, to the file or directory to be deleted."

Thus, we only need it during mount time, so let's pass it to the start method.

Reviewed By: fanzeyi

Differential Revision: D21797080

fbshipit-source-id: 27f5d18841ac077c81ad3f6b3686e20917505c41
2020-06-10 19:29:36 -07:00
Xavier Deguillard
d40d5360b0 prjfschannel: do not do IO in the constructor
Summary:
This will simplify some later diffs where the channel construction doesn't
change any state.

Reviewed By: fanzeyi

Differential Revision: D21797077

fbshipit-source-id: 67d9ee693b067a08986e9bd33f9d91f9a1dadac1
2020-06-10 19:29:36 -07:00
Xavier Deguillard
c5b06ecc0f prjfschannel: remove re-creation of mount directory
Summary: This is already created, no need for re-recreating it.

Reviewed By: fanzeyi

Differential Revision: D21676314

fbshipit-source-id: 8e3eecfb6069f9bed5bfec7ad6631ed8830d796d
2020-06-10 19:29:35 -07:00
Xavier Deguillard
e83578d0b6 prjfschannel: move the static function out of the class
Summary:
These are pure implementation details of ProjectedFs, and don't need to be in
the class, let's move them onto an anonymous namespace in the cpp file.

Reviewed By: chadaustin

Differential Revision: D21676315

fbshipit-source-id: 4fa7088a10256581d7eed2c7cbd90c30a7fef3d2
2020-06-10 19:29:35 -07:00
Xavier Deguillard
7baa3c3bc0 prjfschannel: inline initialize the notification mapping
Summary:
I find this approach to be slighly less error prone due to not having
to manually specify the array size in advance. We lose the field names,
but they should be pretty self explanatory.

Reviewed By: chadaustin

Differential Revision: D21676319

fbshipit-source-id: db4dc993d3dd2a502ae188b08b8d4230939c0415
2020-06-10 19:29:35 -07:00
Xavier Deguillard
3f7a0c519f prjfschannel: use RelativePathPiece instead of wchar_t*
Summary:
This moves the edenToWinPath inside Windows specific files and makes
the interface clear about the kind of path that is expected.

Reviewed By: fanzeyi

Differential Revision: D21676318

fbshipit-source-id: d153bb543da5f481e94f83d52e45c6cc871d1f54
2020-06-10 19:29:34 -07:00
Xavier Deguillard
a29cd80510 mount: remove the need for setFsChannel in tests
Summary:
The only reason tests need to set an FsChannel is for calling
cleanupPrjfsCache. For consistency sake, let's do the same as what we do on
unices: verify if we have a valid channel first.

Reviewed By: wez

Differential Revision: D21676316

fbshipit-source-id: 022ca91d32a7ab047a79acccd7d17dfd7906d527
2020-06-10 19:29:34 -07:00
Xavier Deguillard
d559d2d217 mount: remove most of the ifdef in EdenServer::mount
Summary:
The only missing piece on Windows is the bind mount/redirection due to
folly::Subprocess not being present on Windows.

Reviewed By: wez

Differential Revision: D21676313

fbshipit-source-id: a5ba09be04c94b66edf9d40884753afa3865def2
2020-06-10 19:29:34 -07:00
Xavier Deguillard
1844b98457 mount: rename the various mount/unmount promises
Summary:
We want to use these on Windows too, so let's rename them to not be FUSE
specific.

Reviewed By: wez

Differential Revision: D21676317

fbshipit-source-id: 9f1bde9e0467d8828d4168a69581c8fea54669cd
2020-06-10 19:29:33 -07:00