Commit Graph

16 Commits

Author SHA1 Message Date
Lukas Piatkowski
ca35624029 filenodes: remove transation over filenodes update
Summary:
The transaction is not necessary in there, since if any of the query fails then the commit is not written in changesets table.
We need to remove it, because with many writes to the filenodes table some of the transactions are timing out while waiting for the database's lock for transation

Reviewed By: farnz

Differential Revision: D8220722

fbshipit-source-id: 003b1369abb1a47e8ad37517745ab659116b95f6
2018-06-05 05:58:31 -07:00
Jeremy Fitzhardinge
a2daf8c2d5 mononoke: no need to pass Mysql connection params by value
Summary: It only needs to borrow them.

Reviewed By: kulshrax

Differential Revision: D8244267

fbshipit-source-id: 2a24a3b7c6eb65177e4e26c57650dd7e096b4202
2018-06-04 08:51:25 -07:00
Stanislau Hlebik
0b93cff8d4 mononoke: add a method to fetch all filenodes at once
Summary:
It will be used in getfiles wireproto method. It requires fetching the whole
file history, and doing lots of point lookups is too slow.

Reviewed By: lukaspiatkowski

Differential Revision: D8182050

fbshipit-source-id: b17cb2259b2237f0027bfb499fbe97d9b40b1a62
2018-05-29 04:11:47 -07:00
Stanislau Hlebik
ef4c28f4f1 mononoke: refactor dieselfilenodes
Summary:
Move functionality of converting FilenodeRow into FilenodeInfo into a separate
function. It will be used in the next diff

Reviewed By: lukaspiatkowski

Differential Revision: D8182051

fbshipit-source-id: f2276aa979200f71aa05808595842c09a9f5899f
2018-05-29 04:11:47 -07:00
Stanislau Hlebik
865b59eb46 mononoke: add has_copyinfo
Summary:
Motivation for this change is the following:
We want to avoid doing point lookups to the db to fetch the history, and
instead select the history for a file or a directory with a single select. That
should be many times faster.
After we select the data from filenodes table, we need to fetch  copy info
data. To do that we need to either do lots of point lookups to the fixedcopyinfo (which
undermines the point of doing single select) or construct a giant select
statement. First option is inefficient, the second can introduce big code
complexity.

Instead let's add a single field that says whether we have fixed copy info or
not. Db size increase should be tiny.

For the data that we've already imported I'm planning to run a script that will
fill the has_copyinfo field correctly.

Reviewed By: jsgf

Differential Revision: D8164029

fbshipit-source-id: c91c99b065808a93a9b361914cf9b3822d78cb60
2018-05-27 13:06:17 -07:00
Stanislau Hlebik
44ce21f2b4 mononoke: add stats
Summary: It can be useful to understand how often do we hit a db, write to blobstore, etc

Reviewed By: farnz

Differential Revision: D7806954

fbshipit-source-id: 9c85cbb11e184ae9f7751e05e961980b29b7568a
2018-05-01 06:07:53 -07:00
Jeremy Fitzhardinge
2e7a6fd668 tp2: update to rust-1.25.0
Summary:
Update x86 and aarch64 toolchains, rust-crates-io update.
The `use_nested_groups` feature is now stable, so we don't need to list it in
`#![feature(...)]` lines.

Reviewed By: kulshrax

Differential Revision: D7690730

fbshipit-source-id: 5f74bb01df6bd88a66ac00a82e446c18e3a1c43d
2018-04-21 22:45:55 -07:00
Stanislau Hlebik
0a6f16f39e mononoke: make async filenodes
Summary:
Just as with changesets, let's make filenodes async.

I had to make unit-tests use async_unit, otherwise tokio::spawn() failed with
SpawnedError. I'm not sure why it happened, but async_unit has fixed the issue

Reviewed By: lukaspiatkowski

Differential Revision: D7635554

fbshipit-source-id: c6130b95cee2d60d0b6eec0ab6c1b3e4f3a26ccd
2018-04-21 11:24:24 -07:00
Stanislau Hlebik
18097eff28 mononoke: connection pooling in filenodes
Summary:
Add functions that return a db connection.
This is the first step to make filenodes truly async.
The code is very similar to Diesel Changesets implementation

Reviewed By: lukaspiatkowski

Differential Revision: D7585297

fbshipit-source-id: 93df9ccbbdf0c29d6c977fec83444bc5ba9aa707
2018-04-18 04:09:09 -07:00
Lukas Piatkowski
73034a99b2 CODEMOD: rename mercurial_types::HgFileNodeId to DFileNodeId
Summary: mercurial_types::DFileNodeId should be replaced by types from mononoke_types in most cases. This rename should help with tracking this

Reviewed By: sid0

Differential Revision: D7619290

fbshipit-source-id: aa6a8e55ae3810c4531028c3b3db2e5730fe7846
2018-04-16 03:40:24 -07:00
Lukas Piatkowski
f6c3f72745 CODEMOD: rename mercurial_types::HgChangesetId to DChangesetId
Summary: mercurial_types::DChangesetId should be replaced by types from mononoke_types in most cases and by mercurial::HgChangesetId in others. This rename should help with tracking this

Reviewed By: sid0

Differential Revision: D7618897

fbshipit-source-id: 78904f57376606be99b56662164e0c110e632c64
2018-04-16 03:40:24 -07:00
Lukas Piatkowski
16cbfd5133 CODEMOD: rename mercurial_types::NodeHash to DNodeHash
Summary: mercurial_types::NodeHash should be replaced by types from mononoke_types in most cases and by mercurial::NodeHash in others. This rename should help with tracking this fact.

Reviewed By: sid0

Differential Revision: D7618389

fbshipit-source-id: a876e723d911df626c7851fba56a056843b4e049
2018-04-16 03:40:24 -07:00
Stanislau Hlebik
a248be3bec mononoke: add open_or_create and insert_chunk_size params
Summary:
open_or_create is useful for testing.
insert_chunk_size sets the mysql batch size

Reviewed By: farnz

Differential Revision: D7429043

fbshipit-source-id: 9d651a2f71abb9022c5390d059e4298efb49f38c
2018-03-29 03:29:57 -07:00
Stanislau Hlebik
8fb761a261 mononoke: simple dieselfilenodes-cmd binary
Summary: To query all the parents of the filenode. This emulates getfiles request

Reviewed By: farnz

Differential Revision: D7427133

fbshipit-source-id: 54d054fc7a30db027aa327d3be3b93c86dd3a223
2018-03-28 08:25:40 -07:00
Stanislau Hlebik
f1c86c6eab mononoke: handle copy data in dieselfilenodes
Summary:
Previously all the copy information was ignored. In this diff we are using it.
Note that `paths` table is also used now - it is used to convert from hash of
the path to the real path.

Reviewed By: farnz

Differential Revision: D7381437

fbshipit-source-id: 13f8bf0f269cf40d06693dd0cdca15da40c1ab64
2018-03-28 03:25:27 -07:00
Stanislau Hlebik
f550dfc41d mononoke: diesel filenodes implementation
Summary:
Initial support for filenodes using diesel.
These filenodes implementation is very close to what hg stores in revlog files.
Currently this implementation doesn't support copies.
This issue will be fixed in the next diffs.

Reviewed By: farnz

Differential Revision: D7305910

fbshipit-source-id: bbb0196dbee24c3a99d58055de11d433a518e40b
2018-03-28 03:25:27 -07:00