Commit Graph

8 Commits

Author SHA1 Message Date
Stanislau Hlebik
e6f821ac7d infinitepush: add locktimeout
Summary:
Default lock timeout value is very small (around couple of secs).
Let's set it for something bigger by default

Test Plan: arc unit

Reviewers: rmcelroy, mitrandir, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4435236:1484880747:d46276a82782ef551cda0165dea686f267c13ff9
2017-01-24 10:32:44 -08:00
Stanislau Hlebik
7dc24c7c82 infinitepush: backup local heads and bookmarks
Summary:
Backuping changesets is not enougn for restore. We also want to backup heads
and bookmarks to completely capture the state of the repo.

This diff is the first step in implementing this functionality. It adds new
bundle2 part which contains encoded dict (simple json encoding is used).
If value in the dict is empty then key is the bookmark pattern to delete.
If value is not empty then key is the bookmark name to save and value is a
node hash. The reason to put them in the same part is to make it possible to
delete and insert into indexapi in one transaction. It's also possible to pass
patterns to delete in part parameters but there is a bug in upstream hg that
limits parameters' size to 256 and we can potentially have longer bookmarks.

Local bookmarks are saved in infinitepush in the following form:
  infinitepush/backups/USERNAME/HOSTNAME/REPOROOT/bookmarks/LOCAL_BOOKMARK_NAME

Local heads are saved in infintiepush in the following form:
  infinitepush/backups/USERNAME/HOSTNAME/REPOROOTheads/HEAD_HASH

Hostname, username and repo root is necessary to distinguish different backups.

Test Plan: Run `test-infinitepush-*`

Reviewers: durham, rmcelroy, mitrandir, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4245080:1480518959:aa199d67fac4e2cd2f543651ff56fdd649dac729
2016-12-01 08:44:57 -08:00
Stanislau Hlebik
f6d771aeda infinitepush: addmanybookmarks indexapi method
Summary:
Right now `hg debugbackup` backups only changesets.  We also want to backup
bookmarks.  Since user may have many bookmarks let's add a separate method
that will save many bookmarks at once.

Test Plan: Will be tested in next diffs

Reviewers: durham, rmcelroy, mitrandir, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4244823:1480596116:7114128dafe2b8a10f599d05d68c1a6dce522f4a
2016-12-01 08:41:23 -08:00
Stanislau Hlebik
c2e54d52a7 infinitepush: make indexapi a context manager
Summary:
As @quark suggested let's make `indexapi` a contextmanager.
It greatly simplifies code

Test Plan: Run `test-infinitepush-*`

Reviewers: durham, rmcelroy, mitrandir, quark

Reviewed By: quark

Subscribers: quark, mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4258082:1480596008:32c39150dbb1966e76064ad8d93a808c89d78b71
2016-12-01 08:40:09 -08:00
Stanislau Hlebik
d93c9f9d97 infinitepush: add deletebookmarks method to indexapi
Summary:
This methods accepts list of bookmark patterns to delete (patterns are not
supported yet, but they will be supported).

Test Plan: Will be tested in subsquent diffs

Reviewers: andrasbelo, rmcelroy, durham

Reviewed By: rmcelroy, durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4176016:1479144865:8c9121970878d4d462cc2c679a414999dfdce1f4
2016-11-30 06:49:21 -08:00
Stanislau Hlebik
563a57128e infinitepush: add mysql waittimeout server-side
Summary:
Saw a few timeout errors during infinitepush test.
Previous timeout was 10 secs, it makes sense to increase it.

There was a unit test failures because of the config options.
So this diff also adds missing config docs and copyrights headers.

Test Plan: Build the package, install it locally and run integrationtests

Reviewers: durham, rmcelroy, mitrandir, andrasbelo

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 12479677
2016-11-01 01:44:38 -07:00
Stanislau Hlebik
005a9ace91 infinitepush: bookmarks remote-list
Summary:
Add an option to list remote and scratch bookmarks by pattern.
Only very simple pattern is allowed: either the literal string
or a prefix (like 'scratch/stash/*'). It was made intentionally
to make sure that pattern requests are fast in mysql.

Mysql tests will be added to the integration tests

Test Plan: Run `test-infinitepush-*`

Reviewers: mitrandir, andrasbelo, durham

Reviewed By: durham

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4074409:1477500968:e91cd2505d61a2f1db30c7f00cdcfc949e433507
2016-10-26 10:03:35 -07:00
stash
b421695c98 infinitepush: do not require mysql for tests
Summary:
Tests doesn't require mysql since it uses fileindexapi.
Let's move sqlindexapi and fileindexapi to different files and include
only necessary file.

Test Plan: Run test-infinitepush-*

Reviewers: durham, simonfar, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4029460:1476709161:556f80605db9bd3c18dce1e16e996b13bbe96229
2016-10-17 14:23:56 +01:00