Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 543FE10D55 for ; Mon, 14 Oct 2013 20:45:11 +0000 (UTC) Received: (qmail 16866 invoked by uid 500); 14 Oct 2013 20:45:10 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 16752 invoked by uid 500); 14 Oct 2013 20:45:09 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 16743 invoked by uid 99); 14 Oct 2013 20:45:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 20:45:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 20:45:07 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A4F3B2388A02; Mon, 14 Oct 2013 20:44:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1532084 - /subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c Date: Mon, 14 Oct 2013 20:44:47 -0000 To: commits@subversion.apache.org From: stefan2@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131014204447.A4F3B2388A02@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stefan2 Date: Mon Oct 14 20:44:47 2013 New Revision: 1532084 URL: http://svn.apache.org/r1532084 Log: On the log-addressing branch: Finalize the pack concurrency work. All read code should now work fine in parallel to a background pack run. This patch makes lets the index verification code retry a shard when it got packed while being verified. * subversion/libsvn_fs_fs/verify.c (verify_index_consistency): retry upon error if the pack size changed Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c Modified: subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c URL: http://svn.apache.org/viewvc/subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c?rev=1532084&r1=1532083&r2=1532084&view=diff ============================================================================== --- subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c (original) +++ subversion/branches/log-addressing/subversion/libsvn_fs_fs/verify.c Mon Oct 14 20:44:47 2013 @@ -621,21 +621,37 @@ verify_index_consistency(svn_fs_t *fs, for (revision = start; revision <= end; revision = pack_end) { + svn_error_t *err = SVN_NO_ERROR; + + svn_revnum_t count = pack_size(fs, revision); pack_start = packed_base_rev(fs, revision); - pack_end = pack_start + pack_size(fs, revision); + pack_end = pack_start + count; if (notify_func && (pack_start % ffd->max_files_per_dir == 0)) notify_func(pack_start, notify_baton, iterpool); /* two-way index check */ - SVN_ERR(compare_l2p_to_p2l_index(fs, pack_start, pack_end - pack_start, - cancel_func, cancel_baton, iterpool)); - SVN_ERR(compare_p2l_to_l2p_index(fs, pack_start, pack_end - pack_start, - cancel_func, cancel_baton, iterpool)); + err = compare_l2p_to_p2l_index(fs, pack_start, pack_end - pack_start, + cancel_func, cancel_baton, iterpool); + if (!err) + err = compare_p2l_to_l2p_index(fs, pack_start, pack_end - pack_start, + cancel_func, cancel_baton, iterpool); /* verify in-index checksums and types vs. actual rev / pack files */ - SVN_ERR(compare_p2l_to_rev(fs, pack_start, pack_end - pack_start, - cancel_func, cancel_baton, iterpool)); + if (!err) + err = compare_p2l_to_rev(fs, pack_start, pack_end - pack_start, + cancel_func, cancel_baton, iterpool); + + /* retry the whole shard if it got packed in the meantime */ + if (err && count != pack_size(fs, revision)) + { + svn_error_clear(err); + pack_end = pack_start; + } + else + { + SVN_ERR(err); + } svn_pool_clear(iterpool); }