Re: Subversion Mirror
- In reply to: Warner Losh : "Subversion Mirror"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 22 Oct 2021 05:33:29 UTC
On Thu, Oct 21, 2021 at 5:19 PM Warner Losh <imp@bsdimp.com> wrote: > Greetings, > > This email documents two recent events with the git -> subversion mirror. > This seems like the best way to document these two issues given their > esoteric nature. > > We stopped mirroring stable/12 about a week ago. The root cause of this > outage was traced to there being an empty commit that was merged. This > caused the git cherry-pick that we do to bring these into the git-svn tree > that we use to publish to subversion to fail. The code has been updated to > handle these commits in the future. In the future, empty commits will > simply be skipped. Kyle did these commits to record a commit/backout pair > had been 'merged' so that they stopped showing up in the tools as merge > candidates. Since this metadata exists only in the git world, dropping them > in the subversion world is fine (we've stopped updating mergeinfo data for > stable/12). > > The second incident was when the BETA1 builds were delayed by 23 hours. > This was due to the creation of the releng/12.3 branch in git. This is our > first new releng branch since we started mirroring to svn and the process > was not documented by the author of the git to subversion script (namely > me). It took me a while to understand why simply creating the branch was > insufficient and to realize the proper path forward. > > The proper sequence of events is to create new releng/12.x branch from the > branch point by hand in subversion. All these things should be done as user > git2svn: > > % svn copy file:///home/svn/base/stable/12@r370949 > file:///home/svn/base/releng/12.3 -m 'Create releng/12.3' > > where r370949 was the point in subversion where releng/12.3 was branched. > There turned out to be a problem with this. In git when you create a branch, you make changes to it, unlike in subversion. So when I did the above copy, it got the branch point correct, but lost the changes that went along with the branch creation. I had to cherry-pick 27c4d9242bf086f2038defcd458bb4b146892add (the first change on the releng/12.3 branch) to make things the same and landed the change. Had I to do it again, I'd have written a script to do the git svn dcommit and the git propset to set the commit's name to gjb. I did the latter too slowly and the repo as mirrored with git2svn as the author name, so I changed it back. subversion is terrible about fixing bad metadata once it gets mirrored, so this is the lessor of the various evils. Warner > Once this branch was created, the 'git-svn' pump needed to be primed. The > releng123 branch needed to be added to ~git2svn/git2svn.conf file (and but > not to the list of branches= yet): > > # releng/12.3 config > releng123_name="releng/12.3" > releng123_path=/home/git/freebsd-src-releng-12.3 > > Once that was done, we needed to initialize the git2svn tree that lives on > git2svn.freebsd.org, as the user git2svn: > > % ./gsm2 -b releng123 branch-init > > which will create the necessary git-svn tree for the crontab's 'gsm2 > mirror' command to work. Once the branch has been initialized, releng123 > should be added to the branches= so that commits start to flow. > > These issues have been corrected, so the git -> svn mirror hopefully will > go back to being a background process that just works. One could argue this > should be automated. I've chosen not to automated it because it's a lot > more effort to do that than to document the process should we have a > 12.4-RELEASE in the future (and its associated releng/12.4). > > Finally, we're still mirroring the 11.x branches. This will stop at some > point in the future, though, most likely the next time the mirroring of > 11.x breaks :). > > Warner >