Commit Graph

58182 Commits

Author SHA1 Message Date
Simon Farnsworth
bac2a66965 Rip out internal cache from SQLBlob
Summary: This cache didn't improve performance, and is a reasonable amount of extra code. Just rip it out, and improve higher caching layers if needed.

Reviewed By: StanislavGlebik

Differential Revision: D21818412

fbshipit-source-id: 3ca58bff180c6da91d451754b67b23e61b736059
2020-06-01 10:09:55 -07:00
Simon Farnsworth
c7f5edd7d1 Use MyAdmin to account for replication lag during puts
Summary:
We can kill a single shard's replication with weight of puts; by tracking lag once a second, we can slow down to a point where no shard overloads.

This is insufficient by itself, as it slows all shards down equally (whereas we only want to slow down the laggy shard), but this now avoids high replication lag

Reviewed By: StanislavGlebik

Differential Revision: D21720833

fbshipit-source-id: a819f641206641e80f8edde92006fb08cdcf36a9
2020-06-01 10:09:54 -07:00
Durham Goode
995a2852c1 configs: return bytes for config parsers validation results
Summary:
Previously the return type was String which, in Python 2, could turn into bytes or
unicode depending on the contents of the string. We always want bytes in Python
2, so let's use the Str type instead.

Reviewed By: quark-zju

Differential Revision: D21794189

fbshipit-source-id: 6493fbacab354a78476f522fc3c41b7336dbbdb1
2020-06-01 09:45:19 -07:00
svcscm
8bc207b768 Updating submodules
Summary:
GitHub commits:

082c96dd33
a255651f51

Reviewed By: wittgenst

fbshipit-source-id: e6120ba88da4095c20c5c05dafd4849f5b2eb0a5
2020-06-01 09:03:55 -07:00
Kostia Balytskyi
5cd4583c5a cross_repo: record sync map version_name in synced_commit_mapping
Summary:
Out `CommitSyncConfig` struct now contains a `version_name` field, which is intended to be used as an identifier of an individual version of the `commitsyncmap` in use. We want to record this value in the `synced_commit_mapping` table, so that later it is possible to attribute a commit sync map to a given commit sync.

This is part of a broader goal of adding support for sync map versioning. The broader goal is important, as it allows us to move faster (and troubleshoot better) when sync maps need changing.

Note that when commit is preserved across repos, we set `version_name` to `NULL`, as it makes no sense to attribute commit sync maps to those case.

Reviewed By: farnz

Differential Revision: D21765408

fbshipit-source-id: 11a77cc4d926e4a4d72322b51675cb78eabcedee
2020-06-01 07:16:52 -07:00
Mark Thomas
b2285e0425 progress: add progress bars for edenfs checkout operations
Summary:
The checkout step for EdenFS can take a few seconds if the distance is large or
if EdenFS has to fetch data.  Reassure the user that something is happening
with a progress spinner.

Reviewed By: chadaustin

Differential Revision: D21684077

fbshipit-source-id: 43b8793f1a55ef6fb3bf78cabe3afcf2faed1d6c
2020-06-01 06:26:02 -07:00
Egor Tkachenko
84586b342e Replace hardcoded hgsql db address in mononoke_hg_sync_job
Summary: Parse config inside mononoke_hg_sync_job to get proper hgsql address for repo, instead using address from command-line argument.

Reviewed By: krallin

Differential Revision: D21638740

fbshipit-source-id: 1319126535c2c148be47172663e86a82b5e92b40
2020-06-01 06:05:36 -07:00
Stanislau Hlebik
fde6230ea2 RFC: introduce FilenodeResult
Summary:
The motivation for the whole stack:
At the moment if mysql is down then Mononoke is down as well, both for writes
and for reads. However we can relatively easily improve the situation.
During hg update client sends getpack() requests to fetch files, and currently
for each file fetch we also fetch file's linknode. However hg client knows how
to deal with null linknodes [1], so when mysql is unavailable we can disable
filenode fetching completely and just return null linknodes. So the goal of this stack is to
add a knob (i.e. a tunable) that can turn things filenode fetches on and off, and make
sure the rest of the code deals nicely with this situation.

Now, about this diff. In order to force callers to deal with the fact that
filenodes might unavailable I suggest to add a special type of result, which (in
later diffs) will be returned by every filenodes methods.

This diff just introduces the FilenodeResult and convert BlobRepo filenode
methods to return it. The reason why I converted BlobRepo methods first
is to limit the scope of changes but at the same time show how the callers' code will look
like after FilenodeResult is introduced, and get people's thoughts of whether
it's reasonable or not.

Another important change I'd like to introduce in the next diffs is modifying FilenodesOnlyPublic
derived data to return success if filenodes knob is off. If we don't do that
then any attempt to derive filenodes might fail which in turn would lead to the
same problem we have right now - people won't be able to do hg update/hg
pull/etc if mysql is down.

[1] null linknodes might make some client side operation slower (e.g. hg rebase/log/blame),
so we should use it only in sev-like situations

Reviewed By: krallin

Differential Revision: D21787848

fbshipit-source-id: ad48d5556e995af09295fa43118ff8e3c2b0e53e
2020-06-01 05:27:34 -07:00
Thomas Orozco
006864a6ce lfs v2: don't send empty batch requests
Summary:
We can skip the round trip to the server if we have nothing to ask or tell the
server.

Reviewed By: xavierd

Differential Revision: D21763025

fbshipit-source-id: 7f199c12ccaa0f66ce765dd976723e4002c5dd4e
2020-06-01 03:45:30 -07:00
svcscm
2363833947 Updating submodules
Summary:
GitHub commits:

24834bbaee
a69ad1c401
f8974e8273
62f53377fd
144bfbe1dd
20807e41de
7d673046a6
aed8bb3e04

Reviewed By: wittgenst

fbshipit-source-id: af4a695712c1b53386118068a8454157c2ba6e97
2020-06-01 02:17:50 -07:00
Thomas Orozco
6215d7daa4 common/rust/{scuba, scribe}: use a Duration for flush
Summary:
`flush()` takes a timeout, which is in milliseconds. However, that's not super
obvious, so that means whoever is using this has to re-discover it. Let's make
it explicit, and use a `Duration` argument instead.

(In fact, some places even got it wrong, notably common/rust/cli_usage)

Reviewed By: farnz

Differential Revision: D21783991

fbshipit-source-id: 6e3ac7c22b5c3297b41d5d61373ee077f12d5dd4
2020-06-01 01:38:58 -07:00
svcscm
f3c930db16 Updating submodules
Summary:
GitHub commits:

8f91f84803
617a252e90
377c316aa0

Reviewed By: wittgenst

fbshipit-source-id: 911874b032e2a01190636c5008fd06c0080ee7f4
2020-06-01 01:38:58 -07:00
svcscm
2fa6da1efc Updating submodules
Summary:
GitHub commits:

a9b90b9f87
c367a12920

Reviewed By: wittgenst

fbshipit-source-id: 009f245733795498bfe1c971a375127f79b8451b
2020-05-31 16:26:46 -07:00
svcscm
dba1a66340 Updating submodules
Summary:
GitHub commits:

df6fbfb120
4916927343
38ed706256
2dfa4fbe4d
ae08ad24e8

Reviewed By: wittgenst

fbshipit-source-id: 54e96660e945e3ebfed644aa5e5860ccc53c0779
2020-05-30 22:25:58 -07:00
svcscm
71dff880d9 Updating submodules
Summary:
GitHub commits:

25c055e0b6

Reviewed By: wittgenst

fbshipit-source-id: b43bdf6bfe5ff20157bd6bfab5f8f82e19eeb094
2020-05-29 22:02:30 -07:00
Arun Kulshreshtha
0b4dc0f103 edenapi: add usage examples to make_req
Summary: Added comments showing the expected JSON input format for each kind of EdenAPI request.

Reviewed By: xavierd

Differential Revision: D21782765

fbshipit-source-id: bf08dd4b36a33aca506eb0fa0341e40d0150d7cb
2020-05-29 15:45:10 -07:00
Arun Kulshreshtha
10fa44290e edenapi: use array to specify keys in history requests
Summary: Update the JSON format for history requests to use an array rather than an object to represent keys, for the same reason as D21412989. (Namely, that it's possible for two keys to share the same path, making the path unsuitable for use as a field name in a JSON object.)

Reviewed By: xavierd

Differential Revision: D21782763

fbshipit-source-id: eb04013795d1279ecbf00a8a0be106318695bd05
2020-05-29 15:45:10 -07:00
svcscm
60c23bcf70 Updating submodules
Summary:
GitHub commits:

dc1a385e67
1544932587
1ec10a60ab

Reviewed By: wittgenst

fbshipit-source-id: 4694382d982197e38042c2fdbfbaa085c0f8c6c1
2020-05-29 15:45:09 -07:00
svcscm
cb09b2214f Updating submodules
Summary:
GitHub commits:

cd1f764334
8f13bf87d2

Reviewed By: wittgenst

fbshipit-source-id: b0b63634a37f9fbe5d56f617a006eb6d96f7caae
2020-05-29 13:35:40 -07:00
Durham Goode
a9f8bbf176 treemanifest: always send draft commit trees
Summary:
We encountered an issue where an infinitepush bundle did not contain
trees for some of the commits it contained. This happened when multiple users
were working on the same branch.  Our previous heuristic decided to not send
trees if they weren't in the local store, but with us transitioning to Mononoke
(which enables draft commit data to be fetched ondemand) this invariant doesn't
always hold true.

Let's always upload trees for draft commits. Hopefully Mononoke can take over on
the server completely soon and we can get rid of all this special casing and do
normal discovery.

This is a revert of D7992502, but that was added because it was possible to pull
directly from svn which would result in public commits that didn't exist on the
server yet and therefore needed to send their trees.  Since svn is gone, this is
probably safe to change back.

Reviewed By: quark-zju

Differential Revision: D21697921

fbshipit-source-id: c1abaa061207222490b146ee52f7949be6fe4b2a
2020-05-29 13:21:05 -07:00
svcscm
2b5163fc42 Updating submodules
Summary:
GitHub commits:

23851596f1
e03159028c
011b1c54e5
65603f1e75
c1f9688882
0c56fc4d66
b38f85c31b
c011b36a5a
31d1a244d6
1b3055711f
5e88317ea6
d17b5f7b31

Reviewed By: wittgenst

fbshipit-source-id: 3255cd0e86dc3c45f00d4e52db1158513af561a0
2020-05-29 12:41:56 -07:00
Chad Austin
3b04c02b29 fix flaky integration tests
Summary:
Under heavy parallelism or system load, our tests could trigger
short-ish timeouts and cause tests to flake. The stats test in
particular often failed in continuous integration. It looks like
opening a unix domain Thrift socket early and holding onto it can
cause it to sometimes hit ThriftServer's default idle timeout of 60
seconds, which results in the test failing with BrokenPipeError
(EPIPE).

Reviewed By: simpkins

Differential Revision: D21780023

fbshipit-source-id: 7e8838429475c2a322d836b9a497411199948cce
2020-05-29 11:49:37 -07:00
svcscm
dae04e6a07 Updating submodules
Summary:
GitHub commits:

a1299f09fd
1492869dbd
e5884ae697
6840cc81cb
0494985a1f
6deae0ce10
2f958aa74e
c5abf78bca
60b836e2bf
48f49ea448
9ae8fb988c
b1cb1d32af
61db7f5147
cb4dccfcc0

Reviewed By: wittgenst

fbshipit-source-id: f604bb170c50a73854eeb868b6c2a5f72d29c8e7
2020-05-29 11:01:03 -07:00
Kostia Balytskyi
78bf80c13a metaconfig: learn about version_name for CommitSyncConfig
Summary:
This diff adds support for the `version_name` field, coming from the
`commitsyncmap` config, stored in the configerator.

Note: ATM, this field is optional in the thrift config, but once we get past
the initial deployment stage, I expect it to be present always. This is why
in `CommmitSyncConfig` I make it `String` (with a default value of `""`) rather
than `Option<String>`. The code, which will be writing this value into
`synced_commit_mapping` should not ever care whether it's present or not, since
every mapping should always have a `version_name` present.

Reviewed By: StanislavGlebik

Differential Revision: D21764641

fbshipit-source-id: 35a7f487acf0562b309fd6d1b6473e3b8024722d
2020-05-29 09:31:33 -07:00
Jake Bailey (Hacklang)
9090d7bdf1 Use types from the oxidized_by_ref crate instead of the oxidized crate for to_oxidized
Summary: This diff replaces the use of the oxidized typechecker types in `to_oxidized`, replacing them with oxidized_by_ref definitions. This unblocks deleting typechecker types and decls from the oxidized crate, since they are used only in this debugging-only path. It also reduces the amount of conversion necessary for `to_oxidized` (since we need not convert the oxidized_by_ref structures the typechecker already uses, like `Ty`).

Differential Revision: D21587518

fbshipit-source-id: 5e7ec2237d0059070653b45d15eb7c1259588ccb
2020-05-28 22:19:13 -07:00
Xavier Deguillard
472ec19699 clienttelemetry: add wantslfspointers
Summary:
Rolling out LFSv2 on fbsource is a bit complex. Initially, the intent was to
roll it out via a server-only config and send pointers to say 5% of the
clients. The big snag in this is that LFS pointers are stored in Memcache, and
thus, a client who wasn't supposed to use LFS may end up reading a pointer from
Memcache, and issuing a request to the LFS server. Thanks to the way Memcache
works, this may lead to an avalance effect where everyone is fetching LFS
blobs, even if the server rollout is at a small percentage.

There are several solutions to this, the first obvious one would be to simply
not use Memcache for pointers, but that also means a forced connection to the
server, and a higher latency, ie: not a very desireable situation. An
alternative would be to have a proper capability exchange at connection time,
but that's unfortunately not feasible today due to the need to support the old
Mercurial server. Long term this is definitively the approach we want to go to,
and depending on the exchanged capabilities, we can even imagine using
different memcache keys automatically.

For now, we can hack this up by re-using the only free-form channel that the
client has to the server: clienttelemetry. Mononoke can then use the passed in
information to decide on whether to send LFS pointers (or not). This
unfortunately means that the rollout will be entirely client-side driven. To alleviate
the issue of Memcache keys being shared between clients wanting LFS pointers
and the ones not wanting them, a different Memcache key space will be used.

Reviewed By: StanislavGlebik

Differential Revision: D21765065

fbshipit-source-id: aebda3c567a827342b2fa96d374a06a23ea0ca34
2020-05-28 14:16:35 -07:00
Durham Goode
90c1f357ff configs: whitelist some configs from validation
Summary:
We're going to be changing the configs.* configs via chef as this rolls
out. Let's prevent them from being logged as mismatches.

Also updates the tree bfs config to match the current production value.

Reviewed By: quark-zju

Differential Revision: D21748693

fbshipit-source-id: b1d96f911d7ba7391546515179ac517fc62abe8b
2020-05-28 12:14:09 -07:00
Durham Goode
91a564560f configs: move hgrc list to fb internal module
Summary:
This list is going to grow to list all our rc files, which we don't
need in our public facing repo. Let's move this to a fb internal module.

Reviewed By: quark-zju

Differential Revision: D21747604

fbshipit-source-id: 8d72d8bf981c49b1e10260f5b0858729c1895da1
2020-05-28 12:14:08 -07:00
Durham Goode
0c5a19eaab configs: move Repo enum to fb/ module
Summary:
Let's hide the repo list in the fb/ module since we don't really want
to expose the whole repo list in our public repo.

Reviewed By: sfilipco

Differential Revision: D21731419

fbshipit-source-id: 22ca20a3a80637c852e313f1390849aac1fecbf4
2020-05-28 12:14:08 -07:00
Durham Goode
211ab6f99b configs: add remaining tier-specific rc's to dynamicconfig
Summary:
Adds support for posix, windows, and windows_sandcastle rc files.

This should be low risk, as the dynamic config validator will remove any
incorrect configs before they are used.

Reviewed By: sfilipco

Differential Revision: D21731056

fbshipit-source-id: 0ab8c60906abc2e8d552509462a70a499a52cf86
2020-05-28 12:14:08 -07:00
Durham Goode
1e802fdfd6 configs: add most tier-specific rc's to dynamicconfig
Summary:
Adds support for most files from fb/staticfiles/etc/mercurial/tier-specific
It's missing the windows, posix, and tupperwar files, which I'll do in a later
diff.

This should be low risk, as the dynamic config validator will remove any
incorrect configs before they are used.

Reviewed By: quark-zju

Differential Revision: D21692664

fbshipit-source-id: 9b056640edc880bc683eb331921d08ac24212d59
2020-05-28 12:14:07 -07:00
Genevieve Helsel
1cc1ba124c run eden start command with stdin set to /dev/null
Summary: When calling `eden start` from the CLI layer, make sure to redirect stdin in order to daemonize.

Reviewed By: chadaustin

Differential Revision: D21675707

fbshipit-source-id: 26085cc2ff7774e86f03872030c8885bc3c3b949
2020-05-28 11:32:01 -07:00
Katie Mancini
6801240ecf flag to silence fork error on mac os
Summary:
Currently when you run commands on eden on mac that both fetch data for commit
and update to that commit there is a multithreading bug. This could be a new bug
or an old bug that was not causing problems before, but is showing up a lot more
recently.

See http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html
for a nice explanation of this.

The root cause of this is still unknown, but this flag should bring back the
old behavior where we were not seeing this bug.

Reviewed By: fanzeyi

Differential Revision: D21744987

fbshipit-source-id: 85092e32212e83b16bc00dc0188f03b643c48eea
2020-05-28 10:31:12 -07:00
Tao Zhao
b54708627b scm-prompt.sh: optionally show dirty state of working directory
Summary:
Added an optional feature to scm-prompt.sh to show the dirty state of the working directory.

Users need to opt in by set the environmental variable `SHOW_DIRTY_STATE` to yes (or whatever nonempty string) in their shell rc file. The idea is that users who do not need/want this feature should see minimal performance hit of their prompt.

Unfortunately, in some (large) repos, calling `hg status` or `git diff` to figure out the dirty state can slow down showing the prompt quite a bit. So, in this case, user can opt out individual repo by setting `shell.showDirtyState` in .hg/hgrc or .git/config.

Reviewed By: ahornby

Differential Revision: D21493543

fbshipit-source-id: 13f7cf2dd2f8d00b58cf2a63dc2cbbf770028411
2020-05-28 10:24:52 -07:00
Xavier Deguillard
0cb5ceedfe unify the EdenMain code on Windows
Summary:
Update EdenFS on Windows to use EdenMain.cpp, the same as on POSIX.

This reduces the amount of code divergence, and also brings several
improvements to Windows: exposing version information over fb303, support for
dynamically changing logging configuration over fb303, etc.

Reviewed By: simpkins

Differential Revision: D21332569

fbshipit-source-id: dd2da7c385e96f65fc3927511c9f84b96bec9e2b
2020-05-28 09:01:03 -07:00
Xavier Deguillard
0c4f3b108d revert: Run Eden as a Windows service
Summary:
Wanting to have EdenFS run as a service on Windows cause a couple of issues
on Windows:
 - Needing to log out after installing
 - Forcing Sandcastle to use --foreground, which means the edenfs.log is
   empty, making it impossible to debug anything on Sandcastle,
 - Services can only be started by an elevated user, while the rest of EdenFS
   doesn't have this requirement,
 - Uses undocumented template services

The next diffs in the stack will attempt to solve all of these by starting
EdenFS as a scheduled task instead, which should solve all the above.

Reviewed By: fanzeyi

Differential Revision: D21732280

fbshipit-source-id: b959344da1e77819220d26695ff6634f13ac4e0d
2020-05-28 09:01:03 -07:00
Egor Tkachenko
f12a6d9a77 Revert "rust/thrift: add an option to stop processing requests if client disconnected"
Summary: Reverting as D20763778 is a suspect in causing thrift_server_overload T67609407

Reviewed By: StanislavGlebik

Differential Revision: D21762641

fbshipit-source-id: 545b448afc0954271a2e29d1d3b48fdb959e3d3d
2020-05-28 07:41:09 -07:00
Stanislau Hlebik
7ef7fca580 mononoke: support ManualMove in hg sync job
Reviewed By: krallin

Differential Revision: D21762295

fbshipit-source-id: 4ab66634a0e9976ca2c0de4b2841c0b9bf4afd35
2020-05-28 07:24:05 -07:00
svcscm
b592b8effd Updating submodules
Summary:
GitHub commits:

e0360afe03

Reviewed By: wittgenst

fbshipit-source-id: 2513aed8b08e75d3110747abfecb7248ff664630
2020-05-28 07:19:51 -07:00
Mark Thomas
354c42f32c tests_utils: add_file content can take ownership
Summary:
Change the signature of `CreateCommitContext::as_file` and its associated
functions so that content is `impl Into<String>`, rather than
`impl AsRef<str>`.  The content will immediately be converted to a `String`
anyway, so we can avoid a string copy if the caller already has a string that
can be moved.

Reviewed By: krallin

Differential Revision: D21743429

fbshipit-source-id: d54914386439489fe4e47e37ff9a75c52b1a0443
2020-05-28 06:22:33 -07:00
Mark Thomas
807b7a4261 test_utils: add drawdag support
Summary:
Add support for drawdag in Mononoke unit tests.  Tests can use ASCII DAGs to construct
commit graphs, and can optionally customize the content of each commit.

Reviewed By: krallin

Differential Revision: D21743431

fbshipit-source-id: 9e6a52d1efe67ef4a5519ed7783f953fef7358f1
2020-05-28 06:22:33 -07:00
Mark Thomas
e0228de44a config: sync from configerator
Reviewed By: mitrandir77

Differential Revision: D21742559

fbshipit-source-id: f5e8e8802ddd2a5c760ece341b47b64da1b61277
2020-05-28 03:03:44 -07:00
Mark Thomas
ce103a7886 metaconfig: don't pattern destructure RawInfinitepushParams
Summary:
The parser currently uses pattern destructuring for `RawInfinitepushParams`.  This will break
if new fields are added to this structure.  Instead, use field access like the other raw
params parsers.

Reviewed By: mitrandir77

Differential Revision: D21742558

fbshipit-source-id: 6bfbb080a5e5cdbb02519855472f4df80f9d7453
2020-05-28 03:03:44 -07:00
svcscm
5874113298 Updating submodules
Summary:
GitHub commits:

d976f45ee0
dd570fb3cf
e67de4176c

Reviewed By: wittgenst

fbshipit-source-id: e010f4ec11c7666daad946bc3e5e792b03ff3063
2020-05-28 03:03:43 -07:00
svcscm
7266c29b7d Updating submodules
Summary:
GitHub commits:

984efa75a3
cebecbbaff
0dedce9c3a
3b09ae7f66
59fcae89e3
f91de18ae4
20a7ef9858
7abc8e4594
ed20eb0e18
6fd5b8dfae
37add01a38
fca73296da

Reviewed By: wittgenst

fbshipit-source-id: dff9e170dcd2a81dd361c4bdc55aa8dfe90e1d4c
2020-05-27 21:11:30 -07:00
Genevieve Helsel
83079bd6ca use system configs in HgPrefetchTest
Reviewed By: chadaustin

Differential Revision: D21665935

fbshipit-source-id: 31019020769548e01c011d021a39d7e50e288664
2020-05-27 20:19:19 -07:00
Stanislau Hlebik
57f593f988 configerator-thrift-updater: sync D21743489
Reviewed By: ikostia

Differential Revision: D21743524

fbshipit-source-id: f320c19d5451942ffa3bab73148a657c322ce637
2020-05-27 18:47:01 -07:00
svcscm
6ba00d708d Updating submodules
Summary:
GitHub commits:

28cfb68041
e844b95a8b
72c5bd8a02
bcefc59e9f
0eb6489e21

Reviewed By: wittgenst

fbshipit-source-id: 3fc62a72f8cdd51d1243274fb493465d4801aee4
2020-05-27 13:42:17 -07:00
Stanislau Hlebik
e4023eaf19 mononoke: remove UseExistingIfAvailable from hg sync job
Summary:
It was used only once for testing push redirection. We no longer need it, so
I'd like to delete it to remove this old code and also to make it easier to
support ManualMove bookmarks.

Differential Revision: D21745630

fbshipit-source-id: 362952d95edb923cc4b60359321b563c1e4961de
2020-05-27 13:38:02 -07:00
Jun Wu
14b3c2e0f0 dag: move from_ascii to traits
Summary:
This adds flexibility. Now every type that implements DagAddHeads, including
NameDag, can import ASCII graphs.

Reviewed By: sfilipco

Differential Revision: D21626213

fbshipit-source-id: e258d88f97cbcc9aaf98d353a929803325185df7
2020-05-27 12:16:48 -07:00