Commit Graph

16 Commits

Author SHA1 Message Date
Durham Goode
cedafbb53b fastmanifest: migrate to use new manifestlog.datastore
Summary:
The tree datastores have moved from the svfs to the manifestlog. Let's update
fastmanifest to use them from there.

Test Plan: Ran the tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D235
2017-08-07 19:27:18 -07:00
Kostia Balytskyi
aeef0ad5cc compatibility: migrate from scmutil.vfs to mercurial.vfs.vfs
Differential Revision: https://phabricator.intern.facebook.com/D4908906
2017-04-18 14:42:33 -07:00
Durham Goode
41e13076e1 fastmanifest: fix broken assert
Summary:
This assert is meant to check that at least one source was provided to the
hybridmanifest. The old version was broken though.

The test requires an update because it attempts to construct a hybridmanifest
with no source.

Test Plan: Ran the tests

Reviewers: #fastmanifest, ttung

Reviewed By: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3760229

Signature: t1:3760229:1472062113:695085444915cb15a93db7f317580dcffc2f115d
2016-08-24 11:31:06 -07:00
Tony Tung
4e58c6f814 [fastmanifest] remove shuffle by batch
Summary: We don't need this since we loosely lock the cache worker.

Test Plan: pass existing tests.

Reviewers: lcharignon, durham

Reviewed By: durham

Subscribers: mitrandir, mjpieters, quark

Differential Revision: https://phabricator.intern.facebook.com/D3537355

Signature: t1:3537355:1468268248:ebf7de5bf5030b90039823e1111a073d7eacc447
2016-07-11 14:06:56 -07:00
Laurent Charignon
3542154d80 fastmanifest: fix logic bug in the cache
Summary:
This patch adds a test that uncovers logic bugs in the cache. It also
adds fixes for these bugs.

Test Plan:
Add a new test and ran existing tests, observed no change for
exisiting test.

Reviewers: durham, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3450430
2016-06-21 17:07:46 -07:00
Laurent Charignon
dcc7566c33 fastmanifest: allow creating a systemawarecachelimit without a reference to repo
Summary: This will be useful to refactor the cache

Test Plan:
We change the python test to give a vfs that makes sense, it will
be useful in the next patch when we refactor the cache. Indeed, with the new
cache we use systemawarecachelimit by default instead of no limit

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3427796
2016-06-17 09:35:39 -07:00
Laurent Charignon
a05692e1d2 fastmanifest: pass dummyui in test-fastmanifest.py and remove None guard
Summary:
Before this patch, we were passing None as ui for hybridmanifest's
constructor in test-fastmanifest.py. With this patch, we pass a dummy ui object.
Therefore, it removes the need for None guard in hybridmanifest and simplifies
the code.

Test Plan: Tests pass

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3374069
2016-06-01 13:46:38 -07:00
Tony Tung
09d99415d3 [fastmanifest] move cache management code to cachemanager.py
Summary: yay modularization

Test Plan: pass unit tests.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3355420

Signature: t1:3355420:1464304331:718192fa25d5c6c7de0b18fb79c5f4fd3108ea88
2016-05-26 17:05:01 -07:00
Tony Tung
7503deb3a3 [fastmanifest] easily stealable locks
Summary: We want to wrap the fastmanifest cache priming code in a lock, but we want it to be easily stealable.  If the lock is more than X seconds in age, we just assume it's stale and steal it.  We remember that we stole it so we don't blow away the lock, but we do update the time of the lock so another process doesn't try to steal the lock.

Test Plan: write test to cover basic functionality (mutual exclusivity).  write test to cover stealing, and that only one thief is permitted at a time (subject to race conditions).

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D3343478

Tasks: 11385124

Signature: t1:3343478:1464304447:18658ebea60f98bfda0f034414991ffd6c334ca7
2016-05-26 17:04:23 -07:00
Tony Tung
8b218c9e72 [fastmanifest] split fastmanifest.py into separate files
Summary: This combines D3351047, D3351086, and D3351137 into one diff.  This allows mercurial to better remember where things came from since these are all hg cp commands followed by some edits.  However, they were separated into multiple diffs for ease of reviews.

Test Plan: run unit tests

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3354405

Signature: t1:3354405:1464291057:da140a02b9c87186b1dd9f03f8236d5996319fff
2016-05-26 12:34:38 -07:00
Laurent Charignon
49185d4bb2 fastmanifest: shuffle by batches
Summary:
As discussed in the group, we want to shuffle by batches to keep
an approximate ordering and still avoid caching process fighting for the
same entries.

Test Plan: Add a new test

Reviewers: durham, ttung

Differential Revision: https://phabricator.intern.facebook.com/D3344144
2016-05-26 09:52:55 -07:00
Tony Tung
b5e5af62d4 [fastmanifest] fix indentation of test-fastmanifest.py
Summary: 4 space indents

Test Plan: still passes

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3343502

Signature: t1:3343502:1464134904:276c5de5ad70c22ac523725335f23668666d09b7
2016-05-25 13:23:19 -07:00
Laurent Charignon
0aa4b1c9a0 fastmanifest: add cache limit dependant on the system's free space
Summary:
This adds a new strategy for the cache limit that depends on the free
space availabe in the system. For system with more than 100GB of free space
we allocate 5GB for the cache. With more than 20 GB of free space we allocate
2GB of free space and otherwise 10% of the free space at most.

Test Plan: Add a new test

Reviewers: ttung, durham, rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D3330894
2016-05-23 11:52:42 -07:00
Tony Tung
16d472ded8 [fastmanifest] fetch the fastmanifestcache in the constructor
Summary: since it's a singleton, we can have one instance of the code for retrieving the instance.

Test Plan: run tests/test-fastmanifest.t

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3284113

Signature: t1:3284113:1463416610:207c7e9954cc0b830e77f2fecc0a65acfcfd1096
2016-05-16 12:38:52 -07:00
Laurent Charignon
351a2dad58 fastmanifest: End to end proof of concept
Summary: This adds end to end proof of concept of manifest caching supporting
different manifest type

Test Plan: Added a test

Reviewers: ttung, durham

Differential Revision: https://phabricator.fb.com/D3129530
2016-04-12 14:00:35 -07:00
Laurent Charignon
f630e13113 fastmanifest: add wrapper to instantiate flatmanifest or treemanifest
Summary:
This patch adds a wrapper that allows us to instantiate either flat
or fast manifest when a manifest is read.
This needs a change in core to work. In manifest.manifest in core we are
currently using two abstractions to create manifests: calling manifestdict()
or _newmanifest(). This was a hack added for the developement of treemanifest
and needs to be changed to make things saner.

Test Plan:
I added a new test. I also ran the whole test suite in core with
the extension, all the tests passed except test-treemanifest.t, failing on the
assert in _flatmanifest as expected.
python run-tests.py -j32 -l
   --extra-config-opt=extensions.fastmanifest=/Users/lcharignon/facebook-hg-rpms/fb-hgext/fastmanifest.py

Reviewers: rmcelroy, ttung, durham

Subscribers: mjpieters

Differential Revision: https://phabricator.fb.com/D3115446

Tasks: 10589064
2016-04-08 11:46:18 -07:00