[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: repository too slow suddenly

From: mark benedetto king <mbk_at_lowlatency.com>
Date: 2003-08-14 19:52:14 CEST

On Thu, Aug 14, 2003 at 07:43:08PM +0200, Sander Striker wrote:
> WARNING: you can seriously corrupt your repository if you run recover
> and another process accesses the repository.
>

Should we implement a model where, for normal operation, we do

int rc, fd;
fd = open("/path/to/repo/format", O_RDONLY);
if (fd < 0) error("disaster!");
rc = flock(fd, LOCK_SH | LOCK_NB);
if (rc == EWOULDBLOCK) {
        error("repository being recovered right now!");
}
if (rc < 0) {
        error("disaster!");
}

and for recovery, we do

int rc, fd;
fd = open("/path/to/repo/format", O_RDONLY);
if (fd < 0) error("disaster!");
rc = flock(fd, LOCK_EX | LOCK_NB);
if (rc == EWOULDBLOCK) {
        error("repository still in use!");
}
if (rc < 0) {
        error("disaster!");
}

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 14 22:35:42 2003

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.