Commit Graph

7691 Commits

Author SHA1 Message Date
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
Stanislau Hlebik
eeaedb676a mononoke: remove unsafe_preserve_commit from cross_repo_sync_test_utils
Summary: Just as with the previous diff, let's remove it from cross_repo_sync_test_utisl

Reviewed By: mitrandir77

Differential Revision: D24220618

fbshipit-source-id: 95c5ddc955f720101f6576b34e9787435b6deb4c
2020-10-10 00:19:47 -07:00
Durham Goode
d10157794d eden: add flush command
Summary:
This will allow Eden to control what data is in Mercurial's memory and
what is on disk. This will let it persist the hg_import_helper process longer,
and prevent slow startup times when needing to restart it.

Reviewed By: xavierd

Differential Revision: D24231131

fbshipit-source-id: a4f743740b44957e8d2dd93f07e9831eadfee7ab
2020-10-09 18:18:00 -07:00
Chad Austin
f11c8893c0 always run hg in integration tests with --traceback
Summary:
I observed an integration test fail because Mercurial aborted with an
error about not handling EINTR, but it had no traceback. Always run
Mercurial with --traceback to try to debug these.

Reviewed By: xavierd

Differential Revision: D24204308

fbshipit-source-id: 44960bc645e5f97f61761e511b372328430fcda7
2020-10-09 17:18:12 -07:00
Durham Goode
d4f21a8ec3 atomicfiles: remove fsync from atomic file close
Summary:
This was added in D16078908 (1bc6ecf8fe). It turns out fsync followed by a hardlink
on btrfs results in very slow hardlink performance (100-600ms). Since fewer and
fewer of our files use this atomic write code path and since this affects almost
every hg write command, let's roll this back.

This will increase the chance of data loss during a hard reboot, but commit
cloud is good enough to allow recovering from that in almost every situation.

Reviewed By: sfilipco

Differential Revision: D24230056

fbshipit-source-id: aae1a5612eda5f62bb5ec1442b1312ed45c42786
2020-10-09 16:41:04 -07:00
Chad Austin
9f651a8f28 Remove dead includes in eden
Reviewed By: simpkins

Differential Revision: D23864216

fbshipit-source-id: e1e3803ee47398639bf3cf85e3347d54ecaff424
2020-10-09 15:25:47 -07:00
Jun Wu
e4b677c6e1 remotefilelog: respect invalidatelinkrev store requirement
Summary:
With invalidatelinkrev, linkrev stored in revlog shouldn't be used.
This makes some tests pass with segmented changelog.

Reviewed By: singhsrb

Differential Revision: D24201944

fbshipit-source-id: 6473c30266c79aa97a955b1a6c867411cc67de2b
2020-10-09 13:53:18 -07:00
Jun Wu
7e3dabaab0 context: handle string negative revs with segmented changelog
Summary:
The old code assumes `0..len(repo)` are valid revs, which is no longer true
with segmented changelog.

Reviewed By: singhsrb

Differential Revision: D24201948

fbshipit-source-id: b882a215701c57ccdf4af340c889586b040772da
2020-10-09 13:53:18 -07:00
Jun Wu
2f1c54ae27 clone: copy modern store files
Summary:
Copy segmented changelog, metalog and mutation store for local clones.
This mainly affects tests.

Reviewed By: singhsrb

Differential Revision: D24201941

fbshipit-source-id: c60da9e2bf982a6f66004415e45178749157745e
2020-10-09 13:53:18 -07:00
Jun Wu
631034a2d6 gpg: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201943

fbshipit-source-id: 6998ff68ba50480fb7feb4be3b35de1ea4a3ab4a
2020-10-09 13:53:17 -07:00
Jun Wu
3700c832f9 rebase: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201945

fbshipit-source-id: 57b8fa1f98625ff186fac76009b1600f22e001bb
2020-10-09 13:53:17 -07:00
Jun Wu
38113e78ee summary: remove revnum from output
Reviewed By: singhsrb

Differential Revision: D24201936

fbshipit-source-id: a864fd1030dd8641ead46d434daadae6d4fca244
2020-10-09 13:53:17 -07:00
Durham Goode
43fe23f09d py3: fix revlog path encodings
Summary: This is needed to move our hg servers to python 3.

Reviewed By: quark-zju

Differential Revision: D24204056

fbshipit-source-id: cbaf97893f8f77b535952ac290766f0fd5e14f0c
2020-10-09 13:31:58 -07:00
Stefan Filip
2207e27ce0 segmented_changelog: replace sql log tables with scuba
Summary:
From an OSS perspective, I think that the log tables have a place. However for
daily use perspective, next to scuba they don't add much except retention and
instead feel more heavy weight to manage. This change probably simplifies
things and makes the Segmented Changelog component easier to maintain.

Reviewed By: krallin

Differential Revision: D24213548

fbshipit-source-id: 48a4ea57e3f3911c3bf82b0cc51f118d72119e19
2020-10-09 11:17:03 -07:00
Stanislau Hlebik
9167f3be18 mononoke: remove usage of unsafe_preserve_commit from backsyncer test and use
Summary:
This diff is a first step in a preparation for removing Preserved state from
CommitSyncOutcome. It does two things:

1) Remove unsafe_preserve_commit method and instead rewrite commit with noop
config version - this is exactly how we are going to do it in production
2) While there also select correct mover for validation - previously we were
always picking the current mover

I've also added a bunch of print statements, since it was tricky to debug what
was going on in the test.

Reviewed By: ikostia

Differential Revision: D24216168

fbshipit-source-id: 86e81aea61e638d93bdb33e7c9fd713f7b5e6c3b
2020-10-09 10:35:45 -07:00
Stefan Filip
befcdb1672 tests: fix test-casefolding
Summary: Broken after sweeping changes to remove revnums from tests.

Reviewed By: quark-zju

Differential Revision: D24220976

fbshipit-source-id: bd513b056bf16872ce028c835d680aaa87938917
2020-10-09 10:26:15 -07:00
Stanislau Hlebik
262fa7a139 mononoke: disallow None config version for EquivalentWorkingCopyAncestor and
Summary:
All the new entries in our mapping tables should have their version set. Let's
enforce it in the code

Reviewed By: ikostia

Differential Revision: D24217688

fbshipit-source-id: 95f01d8929a9c3a19b84434c91db6d08a6e5f863
2020-10-09 09:58:11 -07:00
Arun Kulshreshtha
67aa5455aa edenapi: remove commented out code
Summary: Delete commented out code added in D23455274 (bdff69b747).

Reviewed By: sfilipco

Differential Revision: D24213060

fbshipit-source-id: a017b35241521510c26886505d1de6c7f6538895
2020-10-09 09:35:58 -07:00
Stanislau Hlebik
de8393279e mononoke: consider commit Preserved only if version is None
Summary:
To give a bit of context - we are getting rid of Preserved state in
CommitSyncOutcome completely since it can be fully replaced with with
EquivalentWorkingCopyAncestor/RewrittenAs states.

ikostia@ did a similar change in D24142837 (2035a34a0e) to consider Preserved only if
mapping is None. However this diff diff it only for mapping.get() method. Let's do
the same for mapping.get_equivalent_working_copy().

Reviewed By: ikostia

Differential Revision: D24216455

fbshipit-source-id: f1f8d46263de54cb2e11d33b6c17f371b79e80f9
2020-10-09 06:03:41 -07:00