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

[PATCH] Fix "database is locked" error when committing during rep-cache.db verification

From: Denis Kovalchuk <denis.kovalchuk_at_visualsvn.com>
Date: Thu, 30 Apr 2020 20:07:41 +0300


I think I've found a problem with the rep-cache.db verification. If a commit
occurs during the rep-cache.db verification, this can lead to a post-commit
error "database is locked" and new representations will not be added in the
rep-cache.db. The problem occurs because during the verification all cache
entries are retrieved using one large query with holding a sqlite lock, that
prevents adding new cache entries.

The problem can occur for other cases where rep-cache.db is changed, such as
during 'svnadmin build rep-cache'.

I propose to retrieve cache entries in batches and process them without holding
a sqlite lock. I checked that the new approach does not affect the verify
performance and assume that it should work correctly in the case of concurrent
working with the rep-cache.db.

Please see the attached patch. More technical details can be found in the log

Denis Kovalchuk

Received on 2020-04-30 19:08:02 CEST

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