-
Type:
Bug
-
Resolution: Fixed
-
Priority:
High
-
Affects Version/s: 4.2.0
-
Component/s: Enterprise, Smart Mirroring
-
None
Summary
After pull requests are merged (especially when the 'delete branch' checkbox is checked), copies of the repository on Smart Mirrors may become stale until the next push (to any branch) forces a synchronization.
DEBUG level logging on the mirror may show:
2015-12-15 02:49:33,781 DEBUG [threadpool:thread-1] upstream_8dc0bb6c-b31b-3d96-8835-eea2516116bd @1AOHHQKx169x91506x0 fyftjs 172.24.12.181,127.0.0.1 "POST /rest/mirroring/latest/upstreamServers/8dc0bb6c-b31b-3d96-8835-eea2516116bd/addon/events HTTP/1.1" c.a.b.i.m.s.DefaultMirrorSynchronizationHelper STASH/UN/user-management[2785]: upstream and local content hashes differ: 64579f3e-ffef-4250-a03a-783dacc5477b <-> 62274823-143f-439a-ae95-5be259f12daf 2015-12-15 02:49:33,883 DEBUG [threadpool:thread-1] upstream_8dc0bb6c-b31b-3d96-8835-eea2516116bd @1AOHHQKx169x91506x0 fyftjs 172.24.12.181,127.0.0.1 "POST /rest/mirroring/latest/upstreamServers/8dc0bb6c-b31b-3d96-8835-eea2516116bd/addon/events HTTP/1.1" c.a.b.i.m.s.DefaultMirrorSynchronizationHelper STASH/UN/user-management[2785]: all upstream ref changes applied cleanly. No fetch is required.
Workaround
1. You can force a mirrored repository back into sync if you know the repository's numeric ID (on the upstream server). For example, suppose the upstream repository ID is 35:
curl -u $USERNAME:$PASSWORD https://<mirror>/rest/mirroring/latest/upstreamServers/
where $USERNAME and $PASSWORD are the credentials of a system administrator account on the upstream. The result should contain something like "id":"8dc0bb6c-b31b-3d96-8835-eea2516116bd" that gives the "upstream server ID". Then:
curl -u $USERNAME:$PASSWORD -v -X POST -H 'Content-Type:application/json' 'https://<mirror>/rest/mirroring/latest/upstreamServers/8dc0bb6c-b31b-3d96-8835-eea2516116bd/repos/35/synchronization?level=FORCE_ALL'
The result should be 202 Accepted, indicating that the mirror will synchronize the repository in the background.
2. A push to the repository that adds or removes any commits (on any branch) should force a synchronization on all mirrors, bringing them fully back into synchronization with the upstream repository.
Solution
Upgrade both the upstream and mirror instances to Bitbucket 4.7.2 or higher.
- mentioned in
-
Page Loading...