Commit Graph

730 Commits

Author SHA1 Message Date
Alex Hornby
45f521ddde mononoke: enable default patch.crates-io for internal Cargo.tomls
Reviewed By: quark-zju

Differential Revision: D27915811

fbshipit-source-id: 3f830def66c1c5f0569925c42cc8335ee585e0e7
2021-04-22 10:59:42 -07:00
Aida Getoeva
88fefc8736 mononoke: make MySQL FFI default client and remove raw XDB
Summary:
This diff makes MySQL FFI client the default option for a MySQL connection. It means that if no arguments provided, the MySQL FFI client is used. `--use-mysql-client` option is still accepted, as it is used in the configs, and will be removed a bit later.

I also removed raw connections as a way to connect to MySQL from Mononoke, as it is no longer used. Although I had to keep some `sql_ext` API for now because other projects rely on it.
(I talked to the teams and they are willing to switch to the new client as well. I'm helping where it's possible to replace these raw xdb conns.)

Reviewed By: krallin

Differential Revision: D27925435

fbshipit-source-id: 4f08eef07df676a4e6be58b6e351be3e3d3e8ab7
2021-04-22 10:00:13 -07:00
Thomas Orozco
992d6be1e9 mononoke: update tests to stop writing to MONONOKE_TUNABLES_PATH
Summary:
Right now, we can't have defaults in our tunables, because some tests clobber
them. Let's start updating tunables instead of replacing them.

NOTE: I was planning to use this in my next diff, but I ended up not needing
it, that said, it feels like a generally positive improvements, so I figured
I'd keep it.

Reviewed By: StanislavGlebik

Differential Revision: D27915402

fbshipit-source-id: feeb868d99565a375e4e9352520f05493be94a63
2021-04-22 08:19:03 -07:00
Liubov Dmitrieva
e5b00fae7a disable phases exchange if narrow heads is enabled
Summary:
phases calculation could be expensive on the server and it should be a perf win to disable it if not needed

It shouldn't be needed if narrow heads are enabled

Reviewed By: quark-zju

Differential Revision: D27908691

fbshipit-source-id: 7000fb23f9332d58c2c488ffbef14d73af4ac532
2021-04-22 05:26:10 -07:00
Thomas Orozco
689349ae8a mononoke: remove NO_BOOKMARKS_CACHE from tests
Summary:
I'd like to make this a tunable, and having some tests turn it off makes that
more complicated. We can now actually flush this, so it also seems a bit
unnecessary. Let's remove.

Reviewed By: StanislavGlebik

Differential Revision: D27911049

fbshipit-source-id: 4634f9f3243132c53c228bd7476002412bace873
2021-04-21 09:54:12 -07:00
Stefan Filip
cc4d387fa3 tests: add integration test exercising mismatched heads
Summary:
Integration test showing that MismatchedHeads errors are sent over the wire to
the client.

Reviewed By: quark-zju

Differential Revision: D27798555

fbshipit-source-id: b14a213e9055486bf07ecbb4b5453385df701b48
2021-04-20 20:20:24 -07:00
Stefan Filip
9c9e18568c edenapi: send hash-to-location errors to client
Summary:
We want to distinguish between no location and failure to compute location.

It is useful to know on the client side if we failed to compute the location of
some hash or we are not sending it because we don't have a location for it.

We have different options for hash-to-location in particular but the problem is
a general one. Does it make sense for us to skip sending error at the EdenApi
handler layer? I don't think so, I think that's an old hask. We should be
evolving the EdenApi handler layer to handle application errors.

This is still at the exploration phase. I haven't fixed the client side to
handle the errors.

Reviewed By: quark-zju, kulshrax

Differential Revision: D27549926

fbshipit-source-id: 7094160fe997af0e69c8d006b9731ea7dfb3e3f8
2021-04-20 20:20:24 -07:00
Simon Farnsworth
ecf7c4665b Implement a baseline dumb packer
Summary:
This is a baseline packer, to let us experiment with packing.

It chooses the dictionary that gives us the smallest size, but does nothing intelligent around key handling.

Note that at this point, packing is not always a win - e.g. the alias blobs are 432 bytes in total, but the resulting pack is 1528 bytes.

Reviewed By: ahornby

Differential Revision: D27795486

fbshipit-source-id: 05620aadbf7b680cbfcb0932778f5849eaab8a48
2021-04-20 12:45:08 -07:00
Stanislau Hlebik
5c7ff35af8 mononoke: copy bonsai changeset from prod repo to backup repo if they don't match
Summary:
To prevent bonsai changeset divergence between prod and backup repo by copying
bonsais from prod repo directly during hg sync job push.

See more details about motivation in D27824210

Reviewed By: ikostia

Differential Revision: D27852341

fbshipit-source-id: 93e0b1891008858eb99d5e692e4dd60c2e23f446
2021-04-19 09:00:11 -07:00
Thomas Orozco
c2c904f933 mononoke: initialize loggers, config, caching, tunables & runtime in MononokeMatches
Summary:
Basically every single Mononoke binary starts with the same preamble:

- Init mononoke
- Init caching
- Init logging
- Init tunables

Some of them forget to do it, some don't, etc. This is a mess.

To make things messier, our initialization consists of a bunch of lazy statics
interacting with each other (init logging & init configerator are kinda
intertwined due to the fact that configerator wants a logger but dynamic
observability wants a logger), and methods you must only call once.

This diff attempts to clean this up by moving all this initialization into the
construction of MononokeMatches. I didn't change all the accessor methods
(though I did update those that would otherwise return things instantiated at
startup).

I'm planning to do a bit more on top of this, as my actual goal here is to make
it easier to thread arguments from MononokeMatches to RepoFactory, and to do so
I'd like to just pass my MononokeEnvironment as an input to RepoFactory.

Reviewed By: HarveyHunt

Differential Revision: D27767698

fbshipit-source-id: 00d66b07b8c69f072b92d3d3919393300dd7a392
2021-04-16 10:27:43 -07:00
Thomas Orozco
9e92ba1d28 mononoke: always initialize tunables in integration tests
Summary:
We actually require tunables in our binaries, but some of our tests have
historically not initialized them, because the underlying binaries don't
load tunables (so they get defaults).

I'd like to remove the footgun of binaries not initializing tunables, but to do
this I need tunables to be everywhere, which is what this does.

Reviewed By: StanislavGlebik

Differential Revision: D27791723

fbshipit-source-id: 13551a999ecebb8e35aef55c0e2c0df0dac20d43
2021-04-16 10:27:43 -07:00
Jan Mazur
e885d25c86 use ErrorKind instead of generic ahyhow::Error to match on errors
Summary: Changing generic anyhow::Error to ErrorKind so there is no need to downcast when we want to match on errors.

Reviewed By: krallin

Differential Revision: D27742374

fbshipit-source-id: ba4c1779d5919eb989dadf5f457d893a3618fffc
2021-04-16 08:26:29 -07:00
Stanislau Hlebik
e8baaa6bc9 mononoke: log hash validation failures to ods
Summary:
In D27459516 (7dc59708ce) I've added hg filenode hash validation to walker, however I forgot
to start logigng validation failures to walker.

Reviewed By: ahornby

Differential Revision: D27764660

fbshipit-source-id: b012f3d6b0f7a39aa82c966fccc0835ee0b05f0c
2021-04-14 10:17:33 -07:00
Egor Tkachenko
1a7f5eeaa2 Delete commitcloud backfiller source code
Summary:
Continue deletion

byfirebepurged

Reviewed By: StanislavGlebik

Differential Revision: D27708132

fbshipit-source-id: 928525892b8d46a48d4e6043f81e273fd74e8c53
2021-04-14 02:52:30 -07:00
Thomas Orozco
1abb41f42d revisionstore: lfs: add support for downloading content in chunks
Summary:
NOTE: The revisionstore LFS tests talk to prod Mononoke LFS, so the test here
will fail until that is deployed.

Like it says in the title, this adds support for downloading content in chunks
instead of all in one go. The underlying goal here is to let us do better load
balancing server side. This earlier diff in this stack explains that in more
detail: D27188610 (820b538001).

Reviewed By: quark-zju

Differential Revision: D27191594

fbshipit-source-id: 19b1be9bddc6b32b1fabfe4ab5738dfcf71b1a85
2021-04-14 02:49:47 -07:00
Thomas Orozco
a0a7091517 mononoke/lfs_server: reject Range requests that are out of bounds
Summary:
If the caller asks us for a range that extends past the end of our file, we'd
rather give them an error instead of silently returning the file.

This actually revealed one of the tests needed work :)

Note that right now we'll just end up categorizing this as 500. I'd like to
rework the errors we emit in the Filestore, but that's a somewhat bigger
undertaking so I'd like to do it separately.

Reviewed By: quark-zju

Differential Revision: D27193353

fbshipit-source-id: 922d68859401eb343cffd201057ad06e4b653aad
2021-04-13 05:10:00 -07:00
Mark Juggurnauth-Thomas
876f812e4b commitcloud: do not send backup bookmarks part
Summary:
The backupbookmarks part was used for infinitepush backup bookmarks, which were
deprecated.  Now stop sending the part entirely unless
`commitcloud.pushbackupbookmarks` is set.

Reviewed By: StanislavGlebik

Differential Revision: D27710099

fbshipit-source-id: 1eb404f106f5a8d9df6d73e11f60f89c1fa10400
2021-04-13 03:07:50 -07:00
Stefan Filip
5f78ccb284 edenapi: update hash-to-location to discard unknown hashes
Summary:
The hashes that are passed in as parameters to the hash-to-location function
may not be hashes that actually exist. This change updates the code so that
we don't return an error when an unknown hash is passed in. The unknown
hash will be skipped in the list of results.

Reviewed By: quark-zju

Differential Revision: D27526758

fbshipit-source-id: 8bf9b7a134a6a8a4f78fa0df276f847d922472f5
2021-04-09 17:10:57 -07:00
Stefan Filip
f890348720 edenapi/types: add master_heads to HashToLocationRequestBatch
Summary:
We want to handle the case where the client has multiple heads for master. For
example when master is moved backwards (or when it get moved on the client by
force). Updating the request object for HashToLocation to send over all the
master heads.

When the server builds non-master commits, we will want to send over non-master
heads too. We may consider having one big list of heads but I think that we
would still want to distinguish the non-master commit case in order to optimize
that use-case.

Reviewed By: quark-zju

Differential Revision: D27521778

fbshipit-source-id: cc83119b47ee90f902c186528186ad57bf023804
2021-04-09 17:10:57 -07:00
Jan Mazur
0069cc83fe mononoke/lfs_server: return the same urls to client as the Host: they're connecting to
Summary: Currently no matter through which VIP clients are connecting to, they get a response with `"href": "https://monooke-lfs.internal.tfbnw.net"` which prevents us from enabling c2p vip in corp.

Reviewed By: krallin

Differential Revision: D27331945

fbshipit-source-id: f215cce2f64a2a38accd6d55d5100d8d364ce77b
2021-04-08 10:20:13 -07:00
Liubov Dmitrieva
781cd19f2d Add support for wantsunhydratedcommits in Mononke
Summary:
Add support for returning unhydrated draft commits if requested by the client using a config option 'wantsunhydratedcommits'

This is needed to support slow enabling it for some clients like OnDemand.

Reviewed By: StanislavGlebik

Differential Revision: D27621442

fbshipit-source-id: 672129c8bfcbcdb4cee3ba1b092dac16c0b1877d
2021-04-08 03:48:07 -07:00
Stanislau Hlebik
47eee63dc2 mononoke: log file size to the post push scribe logging
Summary:
We already log file count, but file sizes is another useful piece of
information.

I evaluated two options - either do as I did in this diff or just change ScribeToScuba
logging python script to query scs to get file sizes. I opted for option #1
mainly because scs doesn't have a method to query file sizes for many files at once, and
querying one by one might be too expensive. We can add a method like that, but
that's a bit of a bigger change that I'd like.

Reviewed By: andll

Differential Revision: D27620507

fbshipit-source-id: 2618e60845bc293535b190d4da85df5667a7ab60
2021-04-07 23:34:40 -07:00
Ilia Medianikov
ffade38f3d mononoke: tests: filter pycrypto SyntaxWarning when starting Mononoke in integration tests
Reviewed By: krallin

Differential Revision: D27591736

fbshipit-source-id: 311f84847c365916b76a7b718d9e347bd151d8b2
2021-04-07 12:40:28 -07:00
Alex Hornby
1e98362120 mononoke: add checkpoint for input to manual_scrub
Summary: Reduce amount of manual steps needed to restart a manual scrub by checkpointing  where it has got to to a file.

Differential Revision: D27588450

fbshipit-source-id: cb0eda7d6ff57f3bb18a6669d38f5114ca9196b0
2021-04-07 09:30:51 -07:00
Thomas Orozco
c934b67e5b mononoke: remove all trivial usage of async-unit
Summary:
I'd like to just get rid of that library since it's one more place where we
specify the Tokio version and that's a little annoying with the Tokio 1.x
update. Besides, this library is largely obsoleted by `#[fbinit::test]` and
`#[tokio::test]`.

Reviewed By: farnz

Differential Revision: D27619147

fbshipit-source-id: 4a316b81d882ea83c43bed05e873cabd2100b758
2021-04-07 07:26:57 -07:00
Alex Hornby
e907f53bf8 mononoke: add progress to manual_scrub
Summary:
Some manual scrub runs can take a long time.  Provide progress feedback logging.

Includes  a --quiet option for when progress reporting not required.

Reviewed By: farnz

Differential Revision: D27588449

fbshipit-source-id: 00840cdf2022358bc10398f08b3bbf3eeec2b299
2021-04-06 08:45:29 -07:00
Stanislau Hlebik
364457c9f6 mononoke: remove blobimport warmer
Summary:
This warmer hasn't been used, and we aren't going to use it going further.
Let's remove it

Reviewed By: krallin

Differential Revision: D27533802

fbshipit-source-id: deaaf954ed535789ab6b5dc89b8da9967c40e84f
2021-04-06 04:26:06 -07:00
Alex Hornby
d2f915d4dd mononoke: compress manual_scrub output files if requested
Summary: Use async-compression to optionally zstd compress key and error files.

Reviewed By: farnz

Differential Revision: D27467761

fbshipit-source-id: e1ccb7dc32e4c41eaba82a3716cf4d13f64f71ea
2021-04-01 07:02:06 -07:00
Stanislau Hlebik
7dc59708ce mononoke: add hg filenode hash validation to walker
Summary:
We weren't validating any hashes in walker, and so it was entirely possible to
have corrupt content in the repo. Let's start hash validation it by validating hg
filenodes

Reviewed By: ahornby

Differential Revision: D27459516

fbshipit-source-id: 495d59436773d76fcd2ed572e1e724b01012be93
2021-03-31 03:21:49 -07:00
Stanislau Hlebik
b1a4f2f7be mononoke: treat missing nodes differently in walker
Summary:
Current we treat missing just as any other error, and that makes it hard to
have an alarm on blobs that are missing, because any transient error might make
this alarm go off.

Let's instead differentiate between a blob being missing and failed to fetch a
blob because of any other error (i.e. manifold is unavaialble). Turned out this
is not too difficult to do because a lot of the types implement Loadable trait,
which has Missing variant in its errors.

side-note:
It looks like we have 3 steps which treat missing blobs as not being an
error. These steps are:
1) fastlog_dir_step
2) fastlog_file_step
3) hg_filenode_step

I think this is wrong, and I plan to fix it in the next diff

Reviewed By: ahornby

Differential Revision: D27400280

fbshipit-source-id: e79fff25c41e4d03d77b72b410d6d2f0822c28fd
2021-03-30 07:50:31 -07:00
Jun Wu
48cd15ab14 context: add a way to disable revnum resolution
Summary:
Add a way to disable revnum resolution for non-automation (non-HGPLAIN)
usecases. Automation (ex. nuclide-core) still use revision numbers.

Some tests still use revnums. Put them in a list so this feature
does not break them.

Reviewed By: DurhamG

Differential Revision: D27144492

fbshipit-source-id: fba97fc90c7942e53914c29354938178b2637f44
2021-03-29 22:18:42 -07:00
Carolyn Busch
40a856f8f0 Use Bookmark request and response type in endpoint
Summary: Use Edenapi book request and response type in bookmarks edenapi endpoint. Serialize the response as cbor.

Reviewed By: kulshrax

Differential Revision: D27174122

fbshipit-source-id: 6bc7295c25bd355db4625da3c1f8c68349e7b0b7
2021-03-29 18:40:00 -07:00
Egor Tkachenko
cc346a4a5f Allow tailer to use multiple repos per instance
Summary: We have number of small repos which doesn't have much traffic and load so it can be combined in one single tailer job.

Reviewed By: StanislavGlebik

Differential Revision: D27361196

fbshipit-source-id: 3326a7445cf4f0f0cb27fe0f4545cf8ee3357ff2
2021-03-29 16:10:18 -07:00
Stanislau Hlebik
a58b18a974 mononoke: verify bonsai changesets during replay
Differential Revision: D27362903

fbshipit-source-id: 136207fbab3f729e8575d8d06596ce790c3f4783
2021-03-29 12:39:19 -07:00
Stanislau Hlebik
b5d9e79c9c mononoke: start syncing globalrevs to darkstorm repos via hg sync job
Reviewed By: krallin

Differential Revision: D27268740

fbshipit-source-id: d6688d3655b43d4a276c030bc9b0efa851273b7e
2021-03-26 02:12:58 -07:00
Mark Juggurnauth-Thomas
bcc69eed04 test_repo_factory: use test factory for test fixtures
Summary: Use the test factory for test fixtures that are used in many existing tests.

Reviewed By: StanislavGlebik

Differential Revision: D27169432

fbshipit-source-id: bb3cbfa95b330cf6572d1009c507271a7b008dec
2021-03-25 07:34:50 -07:00
Mark Juggurnauth-Thomas
6b16e16fa9 blobrepo: convert to facet container
Summary:
Convert `BlobRepo` to a `facet::container`.  This will allow it to be built
from an appropriate facet factory.

This only changes the definition of the structure: we still use
`blobrepo_factory` to construct it.  The main difference is in the types
of the attributes, which change from `Arc<dyn Trait>` to
`Arc<dyn Trait + Send + Sync + 'static`>, specified by the `ArcTrait` alias
generated by the `#[facet::facet]` macro.

Reviewed By: StanislavGlebik

Differential Revision: D27169437

fbshipit-source-id: 3496b6ee2f0d1e72a36c9e9eb9bd3d0bb7beba8b
2021-03-25 07:34:49 -07:00
Egor Tkachenko
8b7dc976e6 Add support for backup-repo-name argument
Summary: We have support for backup-repo-id, but tw blobimport doesn't have id and have source repo name to use. Let's add support similar to other repo-id/source-repo-id etc.

Reviewed By: StanislavGlebik

Differential Revision: D27325583

fbshipit-source-id: 44b5ec7f99005355b8eaa4c066cb7168ec858049
2021-03-25 06:45:25 -07:00
Johan Schuijt-Li
a90b7d64ea mononoke: replace platform007 tool references with platform009 tools
Reviewed By: HarveyHunt

Differential Revision: D27261636

fbshipit-source-id: 7f53f577fdc52b4f7db0236929721301fde75727
2021-03-24 08:48:32 -07:00
Thomas Orozco
820b538001 mononoke/lfs_server: add support for Range
Summary:
This will let us better load balance across our clients by having them send
requests that are a fixed size. Indeed, right now, load imbalanced between
our hosts seem to be largely attributable to the fact that some hosts are
responsible for a few 150MB+ blobs, whereas others have none of those.

The motivation here is to let clients query us by range. Then, we can just have
clients fetch e.g. ~40MB at a time, and route those to different hosts, thus
eliminating said load imbalance.

Reviewed By: StanislavGlebik

Differential Revision: D27188610

fbshipit-source-id: b9bbe18904cdd88ec7bab2b76e096fd3585c7b78
2021-03-23 03:20:35 -07:00
Jan Mazur
1ca5f6bfae quiet git init command not to print out hint
Summary:
Git client was updated and it started outputting a hint that breaks our tests. It has no meaning in tests so just quiet it.

```
➜  fbcode git init
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint:   git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint:   git branch -m <name>
Initialized empty Git repository in /data/users/mzr/fbsource/fbcode/.git/
```

Reviewed By: StanislavGlebik

Differential Revision: D27232853

fbshipit-source-id: 683ebebb36049adb758e7c26f843f12159a45301
2021-03-23 02:28:52 -07:00
Stanislau Hlebik
78c1530354 mononoke: add a tunable to limit the number of commits in a push
Summary:
While Mononoke should support pushing large commits, it's not clear if we need
(or want) to support pushing a lot of commits. At the very least pushing lots of commits at the same
time can create problems with derivation, but there could be more places that might break.
Besides there's usually an easy way to work around that i.e. sqush commits or push in small batches.
If we ever need to import a lot of it we use tools like blobimport/repo_import,
so blocking pushing of lots of commits should be fine.

Reviewed By: farnz

Differential Revision: D27237798

fbshipit-source-id: 435e61110f145b06a177d6e492905fccd38d83da
2021-03-22 15:41:06 -07:00
Stefan Filip
822209122f segmented_changelog: update logging for seeder
Summary: Update the logs so that it's more clear what is going on.

Reviewed By: quark-zju

Differential Revision: D27145099

fbshipit-source-id: 11ec7b467157d07dd41893dc82f251a1c555365f
2021-03-18 09:51:48 -07:00
Alex Hornby
a7d94d3c43 mononoke: read new packblob config
Summary: We have new config fields available that can specify default compression level,  let's read and use them.

Reviewed By: StanislavGlebik

Differential Revision: D27127455

fbshipit-source-id: 27935fd58da5f1150c9caf56d9601c37f2ae3581
2021-03-18 05:31:22 -07:00
Robin Håkanson
280bd20086 Better Git<->Bonsai conflict reporting
Summary:
Better Git<->Bonsai conflict reporting.
It now prints the conflicting mapping, so one can see if there is a 2xbcs_id -> same git_sha1 or 2xgit_sha1 -> same bcs_id conflict. This is useful when trying to sort out why this issue appeared in the first place.

Reviewed By: ahornby, krallin

Differential Revision: D27058044

fbshipit-source-id: 9db7a210c1b0be3e0e90aa78b561293d6cf29c26
2021-03-17 21:23:09 -07:00
Stefan Filip
e3cd28089c segmented_changelog: ensure master group consistency in on demand update
Summary:
Segmented Changelog distinguishes commits into two groups: MASTER and
NON_MASTER.  The MASTER group is assumed to big and special attention is payed
to it. Algorithms optimize for efficiency on MASTER.

The current state for the segmented_changelog crate in Mononoke is that it does
not assign NON_MASTER commits. It doesn't need to right now. We want to
establish a baseline with the MASTER group. It was however possible for the
on demand update dag to assign commits that were no in the master group to the
master group because no explicit checks were performed. That could lead to
surprising behavior.

At a high level, the update logic that we want is: 1. assign the master
bookmark changeset to the MASTER group, 2. assign other commits that we need to
operate on to the NON_MASTER group. For now we need 1, we will implement 2
later.

Reviewed By: krallin

Differential Revision: D27070083

fbshipit-source-id: 922bcde3641ca25512000cd1a912c5b399bdff4b
2021-03-17 20:12:27 -07:00
Stefan Filip
9fdb3faff6 segmented_changelog: add builder with SegmentedChangelogConfig
Summary:
Pull in SegmentedChangelogConfig and build a SegmentedChangelog instance.
This ties the config with the object that we build on the servers.

Separating the instatiation of the sql connections from building any kind of
segmented changelog structure. The primary reason is that there may be multiple
objects that get instantiated and for that it is useful to be able to pass
this object around.

Reviewed By: krallin

Differential Revision: D26708175

fbshipit-source-id: 90bc22eb9046703556381399442117d13b832392
2021-03-17 20:12:27 -07:00
Stefan Filip
f9599c714d segmented_changelog: add logging to seeder process commit loading
Summary:
Seeding fbsource I found that loading the commits from sql took longer than I
was expecting, around 90 minutes where I was expecting around 10 miuntes.
I added more logging to validate that commits were actively loaded rather
than something being stuck.

Reviewed By: krallin

Differential Revision: D27084739

fbshipit-source-id: 07972707425ecccd4458eec849c63d6d9ccd923d
2021-03-16 20:38:04 -07:00
Stanislau Hlebik
2e3b7d0a65 mononoke: add --skip-last-chunk argument to streaming changelog
Summary:
The way I plan to use new streaming_changelog in prod is by running it
periodically (say, every 15 mins or so). However some repos won't get many
commits in the last 15 mins (in fact, they might get just 1 or 2).
And even for high commit rate repos most of the times the last chunk
will not be a full chunk (i.e. it will be less that --max-data-chunk-size).

If we were just uploading last chunk regardless of its size then the size of
streaming changelog database table would've just keep growing by 1 entry every
15 mins even if it's completely unnecessary. Instead I suggest to add an option
to not upload the last chunk if it's not necessary.

Reviewed By: farnz

Differential Revision: D27045681

fbshipit-source-id: 2d0fed3094944c4ed921f36943b881af394d9c17
2021-03-16 03:29:54 -07:00
Stanislau Hlebik
fb4c1544b9 mononoke: add update command to streaming changelog
Summary:
This command can be used to update already existing streaming changelog.
It takes a newly cloned changelog and updates the new streaming changelog
chunks in the database.

The biggest difference from "create" command is that we first need to figure
out what's already uploaded to streaming changelog. For that two new methods
were added SqlStreamingChunksFetcher.

Reviewed By: farnz

Differential Revision: D27045386

fbshipit-source-id: 36fc9387f621e1ec8ad3eb4fbb767ab431a9d0bb
2021-03-16 03:29:54 -07:00