Commit Graph

7709 Commits

Author SHA1 Message Date
Adam Simpkins
a1c72ad436 revert phabstatus iterator changes from D24066918
Summary:
This reverts D24066918 (a684e53a31).  That diff changed the phabstatus code to use the last
created revset iterator rather than the first for peekahead purposes.

The first revset iterator does appear to be the correct one to wrap.  After
D24066918 (a684e53a31) I consistently see `hg log -r 'draft()' -T'{phabstatus}\n'` make
Phabricator queries for only one diff at a time.  Reverting the changes from
that diff fixes the issue.

Note that the revset argument passed to `hg log` appears to make a difference
in the behavior here.  When using simple revsets including just specific
commit ranges then the peekahead behavior works as expected both before and
after D24066918 (a684e53a31).  However, when using `draft()` in the revset specifier then
the behavior works before D24066918 (a684e53a31), but not after it.

Reviewed By: singhsrb

Differential Revision: D24269910

fbshipit-source-id: c2c2abf6360fe3129a1fc73b5b433b763bce1fd2
2020-10-14 00:31:30 -07:00
Stanislau Hlebik
b83be196e5 mononoke: make parameter name clearer
Reviewed By: krallin

Differential Revision: D24282032

fbshipit-source-id: d004f61fd6b13bc41d88e5659c428ab8ed1cb264
2020-10-13 23:45:22 -07:00
Stanislau Hlebik
3b956b35d0 mononoke: allow non-prefix free mapping
Summary:
In D19023924 (e9df42c192) ikostia allowed non-prefix free movers, however he left the
safeguard in just in case. Well, now we finally need to use non-prefix-free
mapping, so let's remove the safeguard.

Reviewed By: ikostia

Differential Revision: D24277040

fbshipit-source-id: 4d658ad813171ab0dcb23656e95e3e443ec9961a
2020-10-13 23:43:09 -07:00
Stanislau Hlebik
c63927a8b8 mononoke: add megarepo tool that fills NotSyncCandidate entry
Summary:
This is a tool that's handy to use right before the binding. It accepts a list
of large repo changesets, and for each commit does not yet have a mapping it
inserts a NotSyncCandidate. This is exactly what we want to do right before the
bind - we'd like large repo to have most of its commits marked as
NotSyncCandidate.

Reviewed By: ikostia

Differential Revision: D24276642

fbshipit-source-id: b040e5dee981c06da8a4c58dacbb8c2660f0917d
2020-10-13 23:40:08 -07:00
Durham Goode
fe6e10c024 infinitepush: convert sql results to string
Summary:
The infinitepush sqlindex was returning bytes instead of strings, which
caused various formatters to serialize as "b'sadf'" instead of "sadf". Let's fix
the type converter to produce strings on python 3. Note, this is the opposite to
what we do in the hgsql converter. hgsql works with binary data, so we default
to bytes there. The sqlindex doesn't deal with any binary data, so defaulting to
strings is better.

Also updates a comment on the hgsql converter to be accurate. I confirmed there
are no other customer converters in the code base that need updating.

Reviewed By: krallin

Differential Revision: D24282899

fbshipit-source-id: 708732c17626f6ebc2c3cbe7f00afa5771f31d7b
2020-10-13 21:21:12 -07:00
Kostia Balytskyi
ed21f74ceb hooks: cleanup weird conversions
Summary:
Likely `MPath` constructor got more clever since this was written. In any case
I am just happy that it builds.

Reviewed By: farnz

Differential Revision: D24278551

fbshipit-source-id: 2378a43bd01b1826b7f81d294a035053fba5322f
2020-10-13 15:25:39 -07:00
Mateusz Kwapich
33ef6204d8 move to facebook/
Summary:
Bookmark filler doesn't make much sense outside of FB. In fact the commit
filler is already in the `facebook/` dir.

D24253307 contains the fbpkg change that has to be landed in-sync with this one.

Reviewed By: lukaspiatkowski

Differential Revision: D24253070

fbshipit-source-id: 52734ae34779801b4cae4882a6d0880586ef505f
2020-10-13 13:48:51 -07:00
Arun Kulshreshtha
32c109d955 edenapi: send client correlator to server
Summary:
Include the client correlator string from the `clienttelemetry` extension in each EdenAPI HTTP request via the  `X-Client-Correlator` header.

The `ClientIdentityMiddleware` in `gotham_ext` already understands this header (as it is already used by the LFS server), and `gotham_ext`'s `ScubaMiddleware` will automatically include the provided correlator in the server's Scuba samples.

Reviewed By: farnz

Differential Revision: D24282244

fbshipit-source-id: 13d04e706eda38893cff6e740bd1d7bf104e43dd
2020-10-13 13:25:52 -07:00
Genevieve Helsel
82199a1818 add stderr option for eden rage
Summary: Add option to redirect the eden rage output to stderr

Reviewed By: chadaustin

Differential Revision: D24210031

fbshipit-source-id: 736af81de6a41e49c2459a1cd8124123d6928323
2020-10-13 12:15:43 -07:00
Kostia Balytskyi
49c9c3e4f7 hooks: deny_files act upon cross-repo-push-origin
Summary: For the purposes of megarepo, we need to treat certain paths differently depending on whether the push is native to a large repo, or is push-redirected from a small repo. Let's add a separate patterns list to the `deny_files` hook. Of course, we can also add a list, specific for push-redirected pushes, but it seems unneeded atm.

Reviewed By: StanislavGlebik

Differential Revision: D24278409

fbshipit-source-id: 9fd815940bb656ceac6ab234f3a0647a5c57db06
2020-10-13 10:42:40 -07:00
Thomas Orozco
95635fb8e8 mononoke/warm_bookmarks_cache: don't hit MySQL harder if MySQL fails
Summary:
If we fail to read from MySQL, we immediately go back to attempting to read.
That's the exact opposite of what we should be doing. This fixes that by not
changing our poll schedule if we hit an error.

Reviewed By: farnz

Differential Revision: D24279086

fbshipit-source-id: 2c05ec9c33a1e0cbdfb63dda63a68f2a93615512
2020-10-13 10:39:54 -07:00
Lukas Piatkowski
04e75a6097 mononoke/integration tests: prepare dependencies for running tests by getdeps
Summary:
This diff adds all third party dependencies that are required by getdeps to be able to build and runn Mononoke's integration tests.

Also add a stub Makefile with no-op steps that will be filled in next diff.

Reviewed By: ahornby

Differential Revision: D24251894

fbshipit-source-id: 67384ecfd0ced6762dddc3c6e61feb1240b1162d
2020-10-13 09:50:52 -07:00
Lukas Piatkowski
d0eb47f856 mononoke/integration tests: fix for different curl version for test-remotefilelog-lfs-client-certs.t
Reviewed By: ahornby

Differential Revision: D24250984

fbshipit-source-id: d971510063b74d8245670a921002f1d78d3a0b74
2020-10-13 09:50:52 -07:00
Alex Hornby
3cb1aec731 mononoke: reorder scrub walk expansion to reduce queue depth
Summary: Reorder scrub walk expansion to reduce queue depth. The bounded_traversal_stream  inserts to its unscheduled queue at the front, therefore reversing the order of the children, so we want to add the easiest to complete Nodes to the list of edges last.

Reviewed By: farnz

Differential Revision: D24247625

fbshipit-source-id: 59caa5898e7f38f41cc04a15723370de38f8474f
2020-10-13 09:05:00 -07:00
Alex Hornby
c2bb337653 mononoke: delegate chaosblob put to put_impl
Summary:
Delegate chaosblob put to put_impl to remove some duplication.

This is possible as all chaosblob construction has an inner BlobstorePutOps.

Reviewed By: StanislavGlebik

Differential Revision: D24258401

fbshipit-source-id: dee9fce888e5ef9c2f34865c97921b9cc87ac3bf
2020-10-13 06:25:58 -07:00
Kostia Balytskyi
660937cf9d hooks: be aware of native vs push-redirected pushes
Summary:
This change adds some wiring to allow the hooks to treat native vs push-redirected pushes differently. This is needed because `deny-files` needs to block native pushes to `.ovrsource-rest` and `arvr-legacy`, while it needs to allow push-redirection into these directories.

The plan further is to change the actual hook body for `deny_files` to have different handling of the two cases.

Reviewed By: StanislavGlebik

Differential Revision: D24257454

fbshipit-source-id: 2f5931149115210aeeeebb3294a6512effd36350
2020-10-13 05:46:56 -07:00
Lukas Piatkowski
715351d576 mononoke/integration tests: fix test-clienttelemetry.t by disabling features
Summary:
The logic inside `eden/scm/tests/features.py` script enables certain
features of HG on tests based on the name of the test. Mononoke's integration
tests suit reuses eden/scm's tests suit and as a consequence it triggers the
same `features.py` logic. It was fine until D24201934 (f5988c415c) introduced a feature for
test that is named in the same way as one of the Mononoke tests - the
`test-clienttelemetry.t`.

In order to fix this problem Mononoke will pass a `--nofeatures` flag to the
`eden/scm/run-tests.py` invocations that will turn off the usage of
`features.py`.

Reviewed By: farnz

Differential Revision: D24276294

fbshipit-source-id: eb28ed55a05de3b012e37407603c2370adaaad16
2020-10-13 05:28:27 -07:00
Mateusz Kwapich
5b81fe32d0 add a method to create repo object without ACL check.
Summary:
mononoke_api crate which provides high-level abstraction over most of mononoke
has been used in externally facing scs_server so far. That's why all of it's entry
points are validating user identity first.

In D24136239 (42a783999d) I've started using it for iternal sync job. In this world all
operations are authorized and there's no need for extra ACL checks.

I could just add additional arg to the new method but I don't want to make it
easy to accidentally skip ACL checks - that's why I went for separate method
with descriptive namea.

Reviewed By: krallin

Differential Revision: D24261117

fbshipit-source-id: 32f601d970d286cd383ba5c488596d64d09a535e
2020-10-13 03:59:03 -07:00
Alex Hornby
c52f1faba0 mononoke: add put overwrite counters to CountedBlobstore
Summary: Add put overwrite counters to CountedBlobstore.

Reviewed By: StanislavGlebik

Differential Revision: D24254922

fbshipit-source-id: 8de56cee17ebe411e92d1d0e7c4ff2addca6308c
2020-10-13 03:09:39 -07:00
Alex Hornby
1fed539319 mononoke: factor out common code in throttledblob
Summary: Factor out common async limit code in throttledblob to throttled_access function.

Reviewed By: StanislavGlebik

Differential Revision: D24254357

fbshipit-source-id: 8f3277ccc065e3eb93f089edb2f3bd12e80ef352
2020-10-13 03:09:38 -07:00
Alex Hornby
7a65b60841 mononoke: add --blobstore-put-behaviour argument
Summary: Add --blobstore-put-behaviour argument so we can try running some workloads with modified behaviour, firstly with logging on overwrites to gather metrics,  and then not able to overwrite at all.

Reviewed By: StanislavGlebik

Differential Revision: D24109292

fbshipit-source-id: bbea31eb40604fdedc3a0db7a84e99b5b1fe7a23
2020-10-13 03:09:38 -07:00
Alex Hornby
a13cbcf12f mononoke: remove BlobstorePutOps::put_behaviour
Summary:
Remove BlobstorePutOps::put_behaviour and the default implementation of BlobstorePutOps::put_with_status as they did not make sense for multiplexed stores

This resolves the corresponding TODO in multiplexblob/base.rs

Reviewed By: StanislavGlebik

Differential Revision: D24162629

fbshipit-source-id: aa175bbedac473093dd1862226e910dea15c1299
2020-10-13 03:09:38 -07:00
Alex Hornby
570cd79b3a mononoke: make multiplex blobstore a BlobstorePutOps
Summary:
Implement BlobstorePutOps for multiplex blobstores, so restoring the ability to have multiplexes of multiplexes.

Note that this makes BlobstorePutOps::put_behaviour accessor problematic as the inner stores could have different put_behaviour, will remove it in next diff so as to keep this diff reasonable size.

Reviewed By: StanislavGlebik

Differential Revision: D24162235

fbshipit-source-id: 2ace3af5f60607996e449451316c5c0720351f82
2020-10-13 03:09:38 -07:00
Alex Hornby
011f3ffa76 mononoke: add overwrite status logging to multiplexblob puts
Summary:
Add overwrite status logging to multiplexblob puts now that the inner types held all implement BlobstorePutOps

This has the effect of making any configuration that specifies a multiplex of multiplexes invalid, which is addressed in next diff in stack.

Reviewed By: StanislavGlebik

Differential Revision: D24159958

fbshipit-source-id: dd1f70a636dfb36686d796af7afd8d5da8797a23
2020-10-13 03:09:38 -07:00
Alex Hornby
d9777a38fa mononoke: delegate put to put_with_status for logblob
Summary: Delegate put to put_with_status for logblob now that the blobstore factory can provide right inner type.

Reviewed By: StanislavGlebik

Differential Revision: D24109296

fbshipit-source-id: 1493421f632708d8ec24bd9f7c5cd5745f17ae68
2020-10-13 03:09:37 -07:00
Alex Hornby
05e62f0a26 mononoke: delegate put to put_with_status for packblob
Summary: Delegate put to put_with_status for packblob now that the blobstore factory can provide right inner type

Reviewed By: StanislavGlebik

Differential Revision: D24109288

fbshipit-source-id: 745fe3f6398833c9ac51e70f4d1c2959fceba0d5
2020-10-13 03:09:37 -07:00
Alex Hornby
934a491ed3 mononoke: make blobstore_factory PutBehaviour aware
Summary:
Make blobstore_factory PutBehaviour aware by layering all except the final multiplex as BlobstorePutOps

This makes it so all the components that go into a multiplex are BlobstorePutOps,  which is a prerequisite for making the multiplex logging include the Overwrite status.

Reviewed By: StanislavGlebik

Differential Revision: D24109289

fbshipit-source-id: 23f4cedbaebadae194e41cfbff9ef46b651e3fd4
2020-10-13 03:09:37 -07:00
Alex Hornby
4acca67600 mononoke: make logblob PutBehaviour aware
Summary:
log whether puts overwrite keys by implementing BlobstoreWithPutBehaviour for Logblob.

It logs a count of type of overwrite per put so we can sum them up.

Reviewed By: StanislavGlebik

Differential Revision: D24079272

fbshipit-source-id: 81944d92a56b0d3349ef390eb83f9e5bf4ee3d39
2020-10-13 03:09:37 -07:00
Alex Hornby
8df59b224b mononoke: make throttleblob PutBehaviour aware
Summary: Make throttleblob PutBehaviour aware

Reviewed By: StanislavGlebik

Differential Revision: D24109295

fbshipit-source-id: 9d5f712946ba3089facaa8f8c36b48f54338972f
2020-10-13 03:09:37 -07:00
Adam Simpkins
25cb27f395 handle timeouts reading from phabricator
Summary:
If Phabricator takes more than 10 seconds to respond, a `socket.timeout`
exception may be thrown.  Treat this like other networking errors, and simply
report the diff phabricator status as `Error`.  Previously this exception was
unhandled, causing the entire command to abort.

Reviewed By: singhsrb

Differential Revision: D24272274

fbshipit-source-id: f646d111a91f901e09d9f94a1e0102d6dd4d0952
2020-10-13 03:04:02 -07:00
Meyer Jacobs
f9958ca35a taggederror: introduce category and transience metadata and precedence
Summary:
This change introduces two new metadata types, Category and Transience, and a mechanism for Category to provide a default Fault and Transience, which can be overriden by the user.

Also introduces a mechanism for attempting to log exceptions which occur during exception logging, falling back to the previous behavior of just swallowing the exception on failure.

Reviewed By: DurhamG

Differential Revision: D22677565

fbshipit-source-id: 1cf75ca1e2a65964a0ede1f072439378a46bd391
2020-10-12 17:17:34 -07:00
Xavier Deguillard
001c399d6f tests: enable remaining update_tests on Windows
Summary: Only 2 tests aren't passing on Windows.

Reviewed By: genevievehelsel

Differential Revision: D24257788

fbshipit-source-id: 42a0169955bbff6e05e02374c3b3e434bf849ba0
2020-10-12 17:09:41 -07:00
Jun Wu
bd5cfe49b2 commitstore: remove it
Summary:
It only has benchmark code that led to the use of mincode. Now hgcommits is the
main crate for commit storage. `commitstore` without `hg` in its name was
initially planned to support other kinds of commits including git and bonsai.
However we don't have immediate goal for that at present. So let's just remove
the commitstore directory.

Reviewed By: singhsrb

Differential Revision: D24263618

fbshipit-source-id: 84b4861ae490817377e69d8c2006c63331e3db1f
2020-10-12 16:42:58 -07:00
Xavier Deguillard
437031872f fix test-import-t.py take 2
Summary: Whitespaces are needed.

Reviewed By: quark-zju

Differential Revision: D24264452

fbshipit-source-id: a7ecfbe1bba7d14f92d5218f18d55361a3f4319e
2020-10-12 15:43:57 -07:00
Durham Goode
b0e341c311 signals: move signal registering to be behind ui.threaded
Summary:
On the hg servers we're seeing crashes due to signals during syscalls.
Rolling back to prior to the signal changes seems to have fixed it, though we
haven't bisected enough to be sure this is the cause.

The ui.threaded option is already used to opt-out of running on a background
thread, let's also use it to opt-out of the custom signal registering in hopes
that it fixes the server issue, until they can be deprecated.

Reviewed By: quark-zju

Differential Revision: D24254804

fbshipit-source-id: 50e4fc8c7e3a88b5baa49394f6f1edffc946187d
2020-10-12 14:36:47 -07:00
Xavier Deguillard
aec38c3d61 remove .clang-format
Summary:
Since D23247941, .clang-format is no longer behind a symlink, which means that
we can get clang-format niceness on Windows without having our own
.clang-format file.

Thus, let's just remove eden/scm/.clang-format

Reviewed By: ahornby

Differential Revision: D24255987

fbshipit-source-id: 8bbb966949cf0d1c0ad76053f699dd524700183e
2020-10-12 14:34:20 -07:00
Meyer Jacobs
87cc599161 edenapi: add aux data to FileMetadata and DirectoryMetadata, and recursive children field to TreeEntry
Summary: Need to add new quickcheck tests, verify that remove `Serialize` from `TreeEntry` is okay.

Reviewed By: kulshrax

Differential Revision: D23457777

fbshipit-source-id: aa94ed7aa81b41924eba4a8bd1bdc2c737365b77
2020-10-12 14:05:23 -07:00
Alex Hornby
6ed216b54b mononoke: make packblob PutBehaviour aware
Summary: Make packblob PutBehaviour aware

Reviewed By: StanislavGlebik

Differential Revision: D24109291

fbshipit-source-id: 01c4461feef2d84ec1e68703689234de94a3aec5
2020-10-12 12:12:21 -07:00
Alex Hornby
525f206b8d mononoke: make chaosblob PutBehaviour aware
Summary: Make chaosblob PutBehaviour aware

Reviewed By: farnz

Differential Revision: D24109297

fbshipit-source-id: 9b43262f00442bb5e70adf3c220795d23044dbdf
2020-10-12 12:12:21 -07:00
Jun Wu
a35f8765c0 lock: print actual lockinfo on error
Summary:
Change

  abort: repository repo: timed out waiting for lock held by <lockinfo ...>

to:

  abort: repository repo: timed out waiting for lock held by process '842210' on host 'hostname'

Reviewed By: singhsrb

Differential Revision: D24214462

fbshipit-source-id: 65056ebb9764651b2f0126061fafdfdefaa4e9c6
2020-10-12 11:22:20 -07:00
Xavier Deguillard
964e0106c9 tests: fix test-import-t.py
Summary: The rev numbers are almost gone, remove them from the test.

Reviewed By: sfilipco

Differential Revision: D24255156

fbshipit-source-id: 5cbc4a71c2d3f773c5b474d1edce84ceceb50bf9
2020-10-12 10:18:45 -07:00
Alex Hornby
a80176f699 mononoke: make readonlyblob PutBehaviour aware
Summary: Update readonlyblob to be PutBehaviour aware

Reviewed By: StanislavGlebik

Differential Revision: D24109290

fbshipit-source-id: 2108c6969a4c15243efbca10daf64771e72a969b
2020-10-12 07:12:11 -07:00
Alex Hornby
6e2dfa2dd8 mononoke: add sqlblob to the common blobstore tests
Summary: Added sqlblob to the common blobstore tests to make sure it doesn't diverge from expectations for other stores.

Reviewed By: StanislavGlebik

Differential Revision: D24079254

fbshipit-source-id: 49ef1c372171a1594ba298c66d3473ef682d24cc
2020-10-12 07:12:10 -07:00
Alex Hornby
31b900bc08 mononoke: make CountedBlobstoreOps put behaviour aware
Summary:
Add CountedBlobstoreOps so that blobstore layers that need BlobstoreOps can still use counting

This unblocks adding sqlblob to blobstore-test in next diff in stack

Reviewed By: farnz

Differential Revision: D24079256

fbshipit-source-id: 6a6505aff8c8405353a1f10d79f6e6e08911228a
2020-10-12 07:12:10 -07:00
Alex Hornby
60a588aa87 mononoke: make prefixblob put behaviour aware
Summary: Add BlobstorePutOps so that blobstore layers that need BlobstorePutOps can still use PrefixBlob as a wrapper.

Reviewed By: farnz

Differential Revision: D24109298

fbshipit-source-id: 710571e6c30fa8a432d463eedfab5fcc0389baa3
2020-10-12 07:12:10 -07:00
Alex Hornby
48900ae545 mononoke: predicate based PutBehaviour logic to manifoldblob
Summary:
Add predicate based PutBehaviour logic to manifoldblob.

This will prevent overwrites of keys when in IfAbsent mode, and will generate useful logging in OverwriteAndLog and IsAbsent mode.

This change factors our part of the put logic to put_check_conflict, so that it can use re-used from each of the PutBehaviour cases.

Reviewed By: StanislavGlebik

Differential Revision: D24021170

fbshipit-source-id: d2e71afadada3d5e661634449108e6c9f8dc5907
2020-10-12 07:12:10 -07:00
Stanislau Hlebik
edec9b9ab9 mononoke: remove Preserved state
Summary:
We don't have any Preserved entries anymore - now all preserved entries will be
rewritten with "noop" mapping.

This diff removes it completely

Reviewed By: mitrandir77, ikostia

Differential Revision: D24173538

fbshipit-source-id: f2d6238633cea8dc3c06f2e607b2abd76edfca6b
2020-10-12 03:43:14 -07:00
Stanislau Hlebik
e21d37ac92 mononoke: make verify-bookmarks messages a bit easier to read
Summary: source and target were quite confusing. Let's write the actual names instead

Reviewed By: mitrandir77

Differential Revision: D24197071

fbshipit-source-id: ee10fdb9b17fab739b69922c7f74cd50a1aa4884
2020-10-12 02:37:46 -07:00
Stanislau Hlebik
5dc9a65c28 mononoke: make blobimport warmer less spammy
Summary: Let's log it once a minute

Reviewed By: krallin

Differential Revision: D24241063

fbshipit-source-id: fa5237378d7874549891e4a587037c0eed4ab93b
2020-10-12 01:38:20 -07:00
Stanislau Hlebik
22ccf7d858 mononoke: remove tests for preserved state
Summary: This state is going to be removed soon, so no need for tests anymore

Reviewed By: mitrandir77

Differential Revision: D24221363

fbshipit-source-id: 19dce04549ccbfe59255463a73e56c70f1c8bc4d
2020-10-10 00:19:47 -07:00