Commit Graph

8 Commits

Author SHA1 Message Date
Stanislau Hlebik
3b8d29f56b infinitepush: implement saveoptionaljsonmetadata for sqlindexapi
Summary:
Also need to use `with index` to make sure that transaction closes.

Depends on D5255664

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, mitrandir, mjpieters, medson, #sourcecontrol

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

Tasks: 19103180

Signature: t1:5255670:1497557000:906a39810931d92f30c6d6b8e5bfc28e0c888594
2017-06-19 01:27:31 -07:00
Stanislau Hlebik
55969ebfa3 infinitepush: update schema
Summary:
Let's add a special field that would store arbitrary metadata in json format.
It can be used to store, for example, lists of changes files, file diffs etc.

Depends on D5236375

Test Plan: arc unit

Reviewers: #mercurial, azich

Subscribers: #sourcecontrol

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

Tasks: 19103180
2017-06-15 02:36:40 -07:00
Stanislau Hlebik
8c7c7319dd infinitepush: record nodesmetadata
Summary: Let's add a table that will store metadata about infinitepush nodes.

Test Plan: arc unit

Reviewers: #mercurial

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 16899722
2017-03-30 02:07:30 -07:00
Stanislau Hlebik
526184c5c4 infinitepush: pass reponame to 'DELETE from bookmarkstonode...' query
Summary:
I forgot to insert it, fixing it now. It didn't cause problems before because
we delete bookmarks only during backups and backups usually have different
bookmark names

Test Plan: arc unit

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 15389402

Signature: t1:4795310:1490810441:0a044ebe776c65b03c633017c33771d32bfa3e77
2017-03-30 01:16:06 -07:00
Stanislau Hlebik
1f65684b71 infinitepush: pull bookmark during update
Summary:
Currently infinitepush pulls only unknown nodes.
Let's also pull non-existing scratch bookmark during update.

Test Plan: arc unit

Reviewers: durham, rmcelroy, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters, #sourcecontrol

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

Signature: t1:4564626:1487171677:d25db859ff35805f8ffc7741bc14abbc8d84dac3
2017-02-15 09:33: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
Adam Simpkins
d3a77bd1f3 [infinitepush tests] don't hang forever if getdb.sh does not exist
Summary:
Fix the test to abort if getdb.sh does not exist (or otherwise fails), rather
than ignoring the failure and continuing to try and run the remainder of the
test anyway.  Otherwise mysql will hang forever.

The run-tests.py code unfortunately can't even kill the test properly in this
situation, so even with a --timeout argument it still hangs forever.

Test Plan:
Ran the tests without getdb.sh, and confirmed it failed quickly instead of
hanging.

Reviewers: durham, rmcelroy, stash

Reviewed By: stash

Subscribers: net-systems-diffs@, yogeshwer, mjpieters

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

Signature: t1:4242014:1480408476:8e8765ca4567a0436fba0778938f935f87287747
2016-11-29 10:26:27 -08:00
Stanislau Hlebik
e61c86753e infinitepush: add tests for sqlindexapi
Test Plan: Run `test-infinitepush-*`

Reviewers: durham, mitrandir, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters, #sourcecontrol

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

Tasks: 12479677

Signature: t1:4124846:1478537233:afb783ba195fd8f0d6e55d0fb8666220705575cd
2016-11-07 12:35:34 -08:00