2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2018-01-03 17:35:21 +03:00
|
|
|
no-check-code
|
|
|
|
|
2020-01-20 13:42:49 +03:00
|
|
|
$ disable treemanifest
|
2018-01-04 18:22:19 +03:00
|
|
|
$ . "$TESTDIR/hgsql/library.sh"
|
2014-02-07 02:39:57 +04:00
|
|
|
|
|
|
|
# Populate the db with an initial commit
|
|
|
|
|
|
|
|
$ initclient client
|
|
|
|
$ cd client
|
|
|
|
$ echo x > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ initserver master masterrepo
|
2016-12-07 03:04:20 +03:00
|
|
|
$ cat >> master/.hg/hgrc <<EOF
|
|
|
|
> [hgsql]
|
|
|
|
> profileoutput=$TESTTMP/
|
|
|
|
> EOF
|
2014-02-07 02:39:57 +04:00
|
|
|
$ hg -R master log
|
|
|
|
$ hg -R master pull -q client
|
|
|
|
|
|
|
|
$ initserver master2 masterrepo
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg -R master2 log --template '{node}\n'
|
|
|
|
b292c1e3311fd0f13ae83b409caae4a6d1fb348c
|
2014-02-07 02:39:57 +04:00
|
|
|
|
|
|
|
# Verify that reads are not blocked by the repo syncing
|
|
|
|
|
|
|
|
$ cd client
|
|
|
|
$ echo y > y
|
|
|
|
$ hg commit -qAm y
|
|
|
|
$ hg push -q ssh://user@dummy/master
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd master2
|
2016-07-22 17:18:47 +03:00
|
|
|
$ printf "[hooks]\npresyncdb.sleep = sleep 5\n" >> .hg/hgrc
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -l 2 --template "first:{node}\n" --debug &
|
2016-07-22 17:18:47 +03:00
|
|
|
$ sleep 3
|
2015-12-14 23:34:06 +03:00
|
|
|
syncing with mysql
|
2018-09-25 06:39:40 +03:00
|
|
|
getting 1 commits from database
|
2016-07-22 17:18:47 +03:00
|
|
|
running hook presyncdb.sleep: sleep 5
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -l 2 --template "second:{node}\n" --debug
|
2018-04-10 13:59:06 +03:00
|
|
|
locker is still running (full unique id: '*') (glob)
|
2015-12-14 23:34:06 +03:00
|
|
|
skipping database sync because another process is already syncing
|
2020-10-08 06:58:22 +03:00
|
|
|
second:b292c1e3311fd0f13ae83b409caae4a6d1fb348c
|
2016-07-22 17:18:47 +03:00
|
|
|
$ sleep 5
|
2020-10-08 06:58:22 +03:00
|
|
|
first:d34c38483be9d08f205eaae60c380a29b48e0189
|
|
|
|
first:b292c1e3311fd0f13ae83b409caae4a6d1fb348c
|
2014-02-07 02:39:57 +04:00
|
|
|
$ sed -i '/hooks/d' .hg/hgrc
|
|
|
|
$ sed -i '/sleep/d' .hg/hgrc
|
2019-11-21 18:43:29 +03:00
|
|
|
|
|
|
|
# Check hgsql.synclimit
|
|
|
|
|
|
|
|
$ hg log -r . -T '.\n' --debug --config hgsql.synclimit=100000
|
|
|
|
skipping database sync due to rate limit
|
|
|
|
.
|
2014-02-07 02:39:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
# Verify simultaneous pushes to different heads succeeds
|
|
|
|
|
|
|
|
$ printf "[hooks]\npre-changegroup.sleep = sleep 2\n" >> master/.hg/hgrc
|
|
|
|
$ initclient client2
|
|
|
|
$ hg pull -q -R client2 ssh://user@dummy/master
|
|
|
|
|
|
|
|
$ cd client
|
|
|
|
$ hg up -q 1
|
|
|
|
$ echo z1 > z1
|
|
|
|
$ hg commit -qAm z1
|
|
|
|
$ cd ../client2
|
|
|
|
$ hg up -q 1
|
|
|
|
$ echo z2 > z2
|
|
|
|
$ hg commit -qAm z2
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg push -R client -q ssh://user@dummy/master &
|
|
|
|
$ sleep 0.2
|
|
|
|
$ hg push -R client2 -q -f ssh://user@dummy/master2
|
2020-10-08 06:58:22 +03:00
|
|
|
$ hg log -R master -G --template '{desc}\n'
|
|
|
|
o z2
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
|
|
|
│ o z1
|
|
|
|
├─╯
|
2020-10-08 06:58:22 +03:00
|
|
|
o y
|
2020-10-20 03:05:23 +03:00
|
|
|
│
|
2020-10-08 06:58:22 +03:00
|
|
|
o x
|
2014-02-07 02:39:57 +04:00
|
|
|
|
|
|
|
$ sed -i '/hooks/d' master/.hg/hgrc
|
|
|
|
$ sed -i '/sleep/d' master/.hg/hgrc
|