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

Re: svn commit: r1756266 - /subversion/trunk/subversion/libsvn_fs_fs/transaction.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 16 Aug 2016 22:47:13 +0000

ivan_at_apache.org wrote on Sat, Aug 13, 2016 at 13:18:57 -0000:
> Author: ivan
> Date: Sat Aug 13 13:18:57 2016
> New Revision: 1756266
>
> URL: http://svn.apache.org/viewvc?rev=1756266&view=rev
> Log:
> FSFS: Write the sha1->rep mapping in transaction *after* we successfully
> written node revision to disk. Otherwise may get orphaned sha1->rep mapping
> entry if an error occurs when writing p2l index entry.

Should this be backported? I.e., what are the consequences of an
orphaned sha1->rep entry?

If it's possible for an orphaned entry to be added to rep-cache.db
[e.g., by reopening and committing the transaction], then I think this
should be backported. [since that constitutes latent corruption]

Cheers,

Daniel

> * subversion/libsvn_fs_fs/transaction.c
> (rep_write_contents_close): Call store_sha1_rep_mapping() after we
> successfully written node revision to disk and closed proto-revision file.
>
> Modified:
> subversion/trunk/subversion/libsvn_fs_fs/transaction.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/transaction.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/transaction.c?rev=1756266&r1=1756265&r2=1756266&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/transaction.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/transaction.c Sat Aug 13 13:18:57 2016
> @@ -2485,12 +2485,17 @@ rep_write_contents_close(void *baton)
> b->fnv1a_checksum_ctx,
> b->scratch_pool));
>
> - SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
> SVN_ERR(store_p2l_index_entry(b->fs, &rep->txn_id, &entry,
> b->scratch_pool));
> }
>
> SVN_ERR(svn_io_file_close(b->file, b->scratch_pool));
> +
> + /* Write the sha1->rep mapping *after* we successfully written node
> + * revision to disk. */
> + if (!old_rep)
> + SVN_ERR(store_sha1_rep_mapping(b->fs, b->noderev, b->scratch_pool));
> +
> SVN_ERR(unlock_proto_rev(b->fs, &rep->txn_id, b->lockcookie,
> b->scratch_pool));
> svn_pool_destroy(b->scratch_pool);
>
>
Received on 2016-08-17 00:47:16 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.