ansible/hg-ssh: move move global read only reason file to /repo/hg (bug 1475607); r=sheehan
authorGregory Szorc <gps@mozilla.com>
Fri, 13 Jul 2018 20:51:25 +0000
changeset 6187 8f950d2e6762
parent 6186 ae9fcd2023d2
child 6188 0a843bb4173a
push id3033
push usercosheehan@mozilla.com
push dateFri, 13 Jul 2018 20:52:25 +0000
treeherderversion-control-tools@8f950d2e6762 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssheehan
bugs1475607
ansible/hg-ssh: move move global read only reason file to /repo/hg (bug 1475607); r=sheehan If the file is in /etc, then it needs to be created on all potential leader servers. Putting it on the NFS mount next to the repositories (and where the master.<hostname> file is) makes it accessible and atomic across all leaders. Differential Revision: https://phabricator.services.mozilla.com/D2129
ansible/roles/hg-reviewboard/templates/hgrc.j2
ansible/roles/hg-ssh/templates/hgrc.j2
docs/hgmo/ops.rst
hgserver/tests/test-readonly.t
--- a/ansible/roles/hg-reviewboard/templates/hgrc.j2
+++ b/ansible/roles/hg-reviewboard/templates/hgrc.j2
@@ -62,9 +62,9 @@ url = {{ reviewboard_url | mandatory }}
 username = {{ reviewboard_username | mandatory }}
 password = {{ reviewboard_password | mandatory }}
 repobasepath = /repo/hg/mozilla
 
 [pushlog]
 remoteuserprefix = bmo
 
 [readonly]
-globalreasonfile = /etc/mercurial/readonlyreason
+globalreasonfile = /repo/hg/readonlyreason
--- a/ansible/roles/hg-ssh/templates/hgrc.j2
+++ b/ansible/roles/hg-ssh/templates/hgrc.j2
@@ -41,17 +41,17 @@ maxfiles = 2
 
 [serverlog]
 reporoot = /repo/hg/mozilla/
 
 [server]
 validate = True
 
 [readonly]
-globalreasonfile = /etc/mercurial/readonlyreason
+globalreasonfile = /repo/hg/readonlyreason
 
 [obshacks]
 # Allow the replication user to exchange obsolescence markers, even if not
 # enabled to normal users.
 obsolescenceexchangeusers = vcs-sync@mozilla.com
 
 [replication]
 unfiltereduser = vcs-sync@mozilla.com
--- a/docs/hgmo/ops.rst
+++ b/docs/hgmo/ops.rst
@@ -161,17 +161,17 @@ Marking Repositories as Read-only
 Repositories can be marked as read-only. When a repository is read-only,
 pushes are denied with a message saying the repository is read-only.
 
 To mark an individual repository as read-only, create a
 ``.hg/readonlyreason`` file. If the file has content, it will be printed
 to the user as the reason the repository is read-only.
 
 To mark all repositories on hg.mozilla.org as read-only, create the
-``/etc/mercurial/readonlyreason`` file. If the file has content, it will
+``/repo/hg/readonlyreason`` file. If the file has content, it will
 be printed to the user.
 
 Retiring Repositories
 =====================
 
 Users can :ref:`delete their own repositories <hgmo_delete_user_repo>` - this section applies only to
 non-user repositories.
 
@@ -1363,17 +1363,17 @@ To stop all Kafka consumers and writers:
 
    # hgweb*
    $ systemctl stop vcsreplicator@*.service
 
    # hgssh*
    $ systemctl stop hg-master.target
 
 You will also want to make all repositories read-only by creating the
-``/etc/mercurial/readonlyreason`` file (and having the content say that
+``/repo/hg/readonlyreason`` file (and having the content say that
 pushes are disabled for maintenance reasons).
 
 To stop all Kafka and Zookeeper processes::
 
    $ systemctl stop kafka.service
    $ systemctl stop zookeeper.service
 
 To remove all Kafka and Zookeeper data::
@@ -1416,9 +1416,9 @@ You can now start consumer daemons::
 When starting the consumer daemons, look at the journal logs for any issues
 connecting to Kafka.
 
 As soon as the daemons start running, all Nagios alerts for the systems should
 clear.
 
 Finally, make repositories pushable again::
 
-   $ rm /etc/mercurial/readonlyreason
+   $ rm /repo/hg/readonlyreason
--- a/hgserver/tests/test-readonly.t
+++ b/hgserver/tests/test-readonly.t
@@ -42,17 +42,17 @@ Marking individual repo as read-only wor
   remote: prechangegroup.readonly hook failed
   abort: push failed on remote
   [255]
 
   $ hgmo exec hgssh rm -f /repo/hg/mozilla/mozilla-central/.hg/readonlyreason
 
 Global read only file works
 
-  $ hgmo exec hgssh touch /etc/mercurial/readonlyreason
+  $ hgmo exec hgssh touch /repo/hg/readonlyreason
   $ hg push
   pushing to ssh://$DOCKER_HOSTNAME:$HGPORT/mozilla-central
   searching for changes
   remote: all repositories currently read only
   remote: refusing to add changesets
   remote: prechangegroup.readonly hook failed
   abort: push failed on remote
   [255]