Commit Graph

14 Commits

Author SHA1 Message Date
Durham Goode
ad813edcbd treemanifest: enable treemanifest by default in tests
Summary:
Now that all our repos are treemanifest, let's enable the extension by
default in tests. Once we're certain no one needs it in production we'll also
make it the default in core Mercurial.

This diff includes a minor fix in treemanifest to be aware of always-enabled
extensions. It won't matter until we actually add treemanifest to the list of
default enabled extensions, but I caught this while testing things.

Reviewed By: ikostia

Differential Revision: D15030253

fbshipit-source-id: d8361f915928b6ad90665e6ed330c1df5c8d8d86
2019-05-28 03:17:02 -07:00
Durham Goode
2dfd48c8de treemanifest: default to treeonly
Summary:
Now that all our repos are treeonly, let's default the extension to
using treeonly. This opens the doors for moving all the tests to operating on
treeonly repos in a future diff.

Reviewed By: quark-zju

Differential Revision: D15030251

fbshipit-source-id: cd289775174bbacd6a6cdc7a5b07fe7e41238584
2019-05-24 10:00:49 -07:00
Durham Goode
148e70118a treemanifest: sort trees by linkrev before inserting
Summary:
Previously we sorted the trees topologically before inserting them. On
a revlog-backed server, this may mean that trees are written in a different
order from the actual commits. hgsql-backed servers rely on the data being
written in linkrev order so they can be replayed in linkrev order on other
machines, so this broke hgsql replication.

Let's instead sort by linkrev, which will be both topological and satisfy
hgsql's requirements.

Reviewed By: quark-zju

Differential Revision: D15437953

fbshipit-source-id: d4aaaa03b392a6cb6cf1be478aed2583ecb757c5
2019-05-22 09:09:03 -07:00
Durham Goode
9d35dc6f3d treemanifest: add test demonstrating bug in tree+hgsql
Summary:
hgsql relies on all revisions being inserted in linkrev order.
Treemanifest was sorting topologically instead of by linkrev, which resulted in
possible corruption in hgsql backed servers. Let's add a test showing this.

Reviewed By: quark-zju

Differential Revision: D15437952

fbshipit-source-id: 642708d7bf76a0d0843a13f8c23b99108f05444a
2019-05-22 09:09:03 -07:00
Jun Wu
5bb0e8fcf1 tests: remove require-ext.sh
Summary:
The script was used to check dependency on extenral extension. It's no longer
necessary since those "external" extensions are in repo now.

Reviewed By: DurhamG

Differential Revision: D13440398

fbshipit-source-id: 2f228ddee621b84a23f44748d843f29e1f05530e
2018-12-12 18:54:22 -08:00
Jun Wu
4ddedaf7d2 tests: remove most rocksdb test cases
Summary:
RocksDB and InnoDB are highly compatibile. There is no need to test RocksDB
engine for every hgsql related tests. Only use rocksdb for 2 of the tests.

Reviewed By: phillco

Differential Revision: D10055068

fbshipit-source-id: f9b7ef546fe7d457b0390e49014ebbe56d3c12c1
2018-09-26 14:20:15 -07:00
Durham Goode
eabf7f1b4d treemanifest: add root-only sqltreestrip option
Summary:
In the new corruption fix strategy, we're only going to strip the
entries from the root treemanifest revlog. This will leave all the
still-referenced sub-trees available for fetching if clients still have old
references to them, while preventing new references from being taken from the
root nodes.

Reviewed By: phillco

Differential Revision: D8284287

fbshipit-source-id: 4cc20bfdbf7ae5d32074dae22da4d37717ee5728
2018-06-07 11:06:01 -07:00
Durham Goode
ab72f94206 hgsql: add a sqlrefill command
Summary:
This adds a command that can be used to fill a database with data from
existing revlogs. This will be useful in the future for uploading new
repositories as well as fixing any database corruption.

In particular, this is important as a precaution to fixing the treemanifest
corruption.

Reviewed By: farnz

Differential Revision: D8108361

fbshipit-source-id: 20717c2057f2bed82c98323c4a3e9d0c6dbd7df5
2018-06-01 16:33:41 -07:00
Durham Goode
1ce89cff9a hgsql: add sqltreestrip
Summary:
Adds a command for deleting trees from history, both in mysql and
locally. This will be useful for recovering from treemanifest corruption.

Reviewed By: singhsrb

Differential Revision: D8066231

fbshipit-source-id: 34a57572c526d99c62d7d4a9e48d60d668065547
2018-05-21 11:38:52 -07:00
Durham Goode
0ae182a740 hg: default to using bundle2 for pushrebase parts
Summary:
Pushrebase previously defaulted to bundlev1. Now that the server can
support v2, let's default to v2.

Reviewed By: quark-zju

Differential Revision: D7591174

fbshipit-source-id: bc5448490ff319543baedf3f5a1aab160a73ed27
2018-04-13 21:51:53 -07:00
Durham Goode
24653e5e32 hg: add develwarn for bundle1 format
Summary:
We want to deprecate the bundlev1 format, so let's start by adding a
develwarn. Later diffs will update the tests to not use v1, then remove v1 as a
supported outgoing bundle entirely.

Reviewed By: quark-zju

Differential Revision: D7591166

fbshipit-source-id: 143ad029bfe4d141f91d6d5077342dfa44ad2944
2018-04-13 21:51:52 -07:00
Thomas Jacob
0e6b93a0e0 Add support for RocksDB
Summary:
- Add support for RocksDB engine (developed as a drop in replacement for innodb) to hgsql to allow new xdb.hgsql.1-10 shards to host hg repos
- Prefer MySQL test DBs in same region
- Run all hgsql unit tests also for RocksDB engine
- Allow for nested ifs to make that possible (downside if you switch off rockdb tests, innodb tests are run twice)

Reviewed By: quark-zju

Differential Revision: D7014064

fbshipit-source-id: 073c36176aa7eaf74252ef33c3f47da594920b28
2018-04-13 21:51:13 -07:00
Durham Goode
88ec218bd4 hg: fix hgsql treemanifest test
Summary:
The import was using the old format here. Let's use the requireext
check instead to be more robust.

Reviewed By: quark-zju

Differential Revision: D6803848

fbshipit-source-id: cb8474245414c946a1ab6cc6c3cec18cd831de0d
2018-04-13 21:50:57 -07:00
Mark Thomas
742cd624f7 hgsql: integrate with hg-crew
Summary:
Move hgsql into the hgext directory, and the tests to tests/test-hgsql-*.

Update the tests to refer to the new places for things.

Test Plan: Run the hgsql tests and make sure they pass.

Reviewers: #sourcecontrol

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

Tasks: T24908724
2018-01-04 07:22:19 -08:00