Summary:
Previously, when running with an external MySQL setup, it's easy to get the
following "mysterious" error when trying to create the "revisions" table:
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
This is a cleanup of many minor areas to make it easier for external users
to run the test.
* Move database schema to `schema.sql`, which could be used as `mysql`
input directly. Remove schema in other places so `schema.sql` is the
single source of truth.
* Change `repo`, `namespace` fields to `varchar` to save space.
* Explicitly set `latin1(_bin)` in schema to avoid potential encoding
issues. Also specify `InnoDB` to avoid issues of other engines.
* Source `getdb.sh` instead of parsing its output. Simplifies `getdb.sh`.
* Provide an example of `getdb.sh` as `getdb.sh.example`.
* Add `DROP DATABASE` cleanup. External setup probably don't have `testdb`
dropped automatically.
* Change `README.md` with the latest instruction about database and test.
* Bundle `hg-ssh` so `test-pushpull.t` won't fail if it's missing.
Test Plan: `run-tests.py` and it mostly works on a local, non-prod Linux system.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: stash, rmcelroy, tja, durham, andrasbelo
Differential Revision: https://phabricator.intern.facebook.com/D4313981
Signature: t1:4313981:1490381520:7c0c9af72ac3446c5ee31f8c9b4376c4198a6dc8
Summary:
Previously, if we needed to disable hgsql for some reason (like testing
corruption, etc) we would just disable the extension. Since we now add a
requires flag to repos that are created with hgsql, this no longer works.
Let's add a config option that can disable hgsql instead and update the tests to
use it. I'm not sure how these test failures slipped through the original
commit.
Test Plan: Ran the tests
Reviewers: #mercurial, ttung, simonfar
Reviewed By: simonfar
Subscribers: simonfar
Differential Revision: https://phabricator.intern.facebook.com/D3289119
Signature: t1:3289119:1462999047:f33337610a1777c379adb70ec307971823f7ae59
Summary:
pretxnclose hooks were incorrectly running during the sql sync. Since the
commits have already been committed (on another machine), there's no need to run
the hooks, so let's disable them.
Test Plan: Added a test
Reviewers: pyd, lcharignon, akushner, rmcelroy
Differential Revision: https://phabricator.fb.com/D2173886
Summary:
The hg-ssh wrapper prevents all transactions from running, including the one we
use to sync our repositories from hgsql. This patch updates hgsql to override
that hook temporarily during syncs.
This wasn't an issue before because upstream mercurial used to hook on
prechangegroup which hgsql did not fire.
Test Plan: Added a test. Verified it failed before, and passes now.
Reviewers: pyd, lcharignon, rmcelroy, sid0
Differential Revision: https://phabricator.fb.com/D2148580
Summary:
This can't hurt anything, and it makes sure we have a fresh
transaction for the references which have been timing out, strangely.
Test Plan: run_tests.py
Reviewers: durham
Reviewed By: durham
Subscribers: durham
Differential Revision: https://phabricator.fb.com/D2137954
Signature: t1:2137954:1433811692:1234cde23efd2fa8a95ad87453390aa8edeb335d
Upstream Mercurial no longer always calls bookmark.write to serialize the
bookmarks. Now it sometimes goes through the transaction API which calls
bookmark._write.
The previous change that allowed transactions that didn't touch revlogs was
broken. It allowed transactions like 'strip', etc. This reverts that.
To fix the actual issue we were trying to fix before, we now add a sql
transaction around local phase moves as part of exchange.
Summary:
In certain pull use cases (hg pull -B foo), it tries to update the bookmarks
outside of the normal bookmark.updatefromremote() function. This takes the lock
at the very beginning of the pull so all inner bookmark manipulations should
succeed.
Test Plan:
Ran the new test with and without the fix, verified it failed before
and passed afterwards.
Reviewers: sid0, davidsp
Differential Revision: https://phabricator.fb.com/D1214148
Pushing and pulling local bookmarks was a bit broken, since as soon as the
bookmark dict tried to write, it would sync with the db, which overwrote the
current bookmarks.
This changes it to require the sql connection to be set up and locked before
the bookmark modifications even start to happen.