You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@foad.me.uk> on 2024/04/17 09:23:28 UTC

Clarify whether svnadmin commands are safe to run on a live repo

Yesterday I was pleased to notice that we had gained an "svnadmin 
build-repcache" command in 1.14, thanks to Denis Kovalchuk of VisualSVN.

 
https://subversion.apache.org/docs/release-notes/1.14#svnadmin-build-repcache
   https://svn.apache.org/r1875921

To an inexperienced svn admin, this feels like the kind of procedure 
that falls in the "repository repair" category, of procedures that are 
not necessarily safe to run unless one knows the intimate details of how 
it all works.

An administrator needs to know in particular whether they must stop the 
server before running this. It isn't stated in the help or the release 
notes. An explicit statement would help.

Looking at the code, I see it calls svn_repos_open3() which, according 
to its doc string, blocks until any exclusive lock is gone and then 
acquires a shared lock on the repo. That sounds to me like it's safe to 
run on a "live" repo.

Do I read that right?

Index: subversion/svnadmin/svnadmin.c
===================================================================
--- subversion/svnadmin/svnadmin.c	(revision 1915904)
+++ subversion/svnadmin/svnadmin.c	(working copy)
@@ -311,8 +311,12 @@
      "usage: svnadmin build-repcache REPOS_PATH [-r LOWER[:UPPER]]\n"
      "\n"), N_(
      "Add missing entries to the representation cache for the repository\n"
      "at REPOS_PATH. Process data in revisions LOWER through UPPER.\n"
      "If no revision arguments are given, process all revisions. If only\n"
      "LOWER revision argument is given, process only that single 
revision.\n"
+    "\n"), N_(
+    "This is safe to run on a repository that is in use. It holds a 
shared\n"
+    "lock while it runs, blocking commits. It may hold the lock for a\n"
+    "considerable time. It is safe to interrupt and run again.\n"
     )},
     {'r', 'q', 'M'} },

Would this wording be useful and correct?

Then I found myself wondering the same question about all the other 
svnadmin commands. Without tracing all the code, it "feels" to me like 
this is the common pattern used in svnadmin and so probably the same or 
similar statements apply to most or all of its subcommands. Does anyone 
want to check the facts, or express an opinion about whether we should 
update all the help strings or if we can add a single statement in 
"svnadmin help" that covers all of them?

- Julian


-- 
- Matrix me: @julian:foad.me.uk <https://matrix.to/#/@julian:foad.me.uk>
- Follow me: @julian@fed.foad.me.uk <https://fed.foad.me.uk/julian>