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

Re: [Issue 4129] predecessors links on root node-revision skip revisions

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 25 Jul 2012 11:09:54 +0100

Daniel Shahaf <danielsh_at_elego.de> writes:

> Philip Martin wrote on Wed, Jul 25, 2012 at 10:49:36 +0100:
>>
>> I attached to the issue a repository that demonstrates the corruption;
>> verify doesn't report a problem on that repository. What does verify
>> check?
>
> validate_root_noderev() catches an instance of the #4129 corruption and
> in its docstring xrefs svn_fs_fs__verify(), so I think the checks in the
> former are done in the latter too.

validate_root_noderev is only called by write_final_rev and not during
verify. svn_fs_fs__verify calls svn_fs_fs__verify_root and that does:

        /* Issue #4129: bogus predecessors. */
        /* Check 1: predecessor must be an earlier revision.
         */
        if (pred_rev >= root->rev)
          return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                                   "r%ld's root node's predecessor is r%ld"
                                   " but must be earlier revision",
                                   root->rev, pred_rev);

        /* Check 2: distances must be a power of 2.
         * Note that this condition is not defined by the FSFS format but
         * merely a byproduct of the current implementation. Therefore,
         * it may help to spot corruptions for the time being but might
         * need to be removed / relaxed in later versions.
         */
        delta = root->rev - pred_rev;
        if (delta & (delta - 1))
          return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
                                   "r%ld's root node's predecessor is r%ld"
                                   " but the delta must be a power of 2",
                                   root->rev, pred_rev);

which doesn't catch the corruption I introduced namely that /@4 and /A_at_4
have predecessor /@2 and /A_at_2 rather than /@3 and /A_at_3.

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2012-07-25 12:10:32 CEST

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

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