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

RE: svn commit: r1716548 - /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Wed, 25 Nov 2015 23:27:44 +0100

> -----Original Message-----
> From: rhuijben_at_apache.org [mailto:rhuijben_at_apache.org]
> Sent: woensdag 25 november 2015 22:31
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1716548 -
> /subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
>
> Author: rhuijben
> Date: Wed Nov 25 21:31:20 2015
> New Revision: 1716548
>
> URL: http://svn.apache.org/viewvc?rev=1716548&view=rev
> Log:
> Create simpler reproduction recipe for BDB issue julian found using
> svnmover+BDB+ra_serf.

Any BDB hackers around that know the background behind this?

The question is: Why isn't the base revision properly saved in the txn when the HEAD revision is a no-op commit?

I'm guessing that we safe something else and then accidentally fetch the last modified revision of that and use it as the BASE revision of the transaction.

        Bert
>
> * subversion/tests/libsvn_fs/fs-test.c
> (reopen_trivial_transaction): Extend test.
>
> Modified:
> subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
>
> Modified: subversion/trunk/subversion/tests/libsvn_fs/fs-test.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_fs/
> fs-test.c?rev=1716548&r1=1716547&r2=1716548&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/tests/libsvn_fs/fs-test.c (original)
> +++ subversion/trunk/subversion/tests/libsvn_fs/fs-test.c Wed Nov 25
> 21:31:20 2015
> @@ -225,6 +225,8 @@ reopen_trivial_transaction(const svn_tes
> /* Don't use the subpool, txn_name must persist beyond the current txn */
> SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
>
> + SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == 0);
> +
> /* Create a third transaction - we don't want that one to reopen. */
> SVN_ERR(svn_fs_begin_txn(&txn, fs, 0, subpool));
>
> @@ -238,7 +240,43 @@ reopen_trivial_transaction(const svn_tes
> SVN_ERR(svn_fs_txn_root(&root, txn, subpool));
> SVN_TEST_STRING_ASSERT(svn_fs_txn_root_name(root, subpool),
> txn_name);
>
> + SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == 0);
> +
> + {
> + const char *conflict;
> + svn_revnum_t new_rev;
> + SVN_ERR(svn_fs_commit_txn(&conflict, &new_rev, txn, subpool));
> + SVN_TEST_STRING_ASSERT(conflict, NULL);
> + SVN_TEST_ASSERT(new_rev == 1);
> + }
> +
> /* Close the transaction ... again. */
> + svn_pool_clear(subpool);
> +
> + /* Begin another transaction that is based on revision 1. */
> + SVN_ERR(svn_fs_begin_txn(&txn, fs, 1, subpool));
> +
> + /* Don't use the subpool, txn_name must persist beyond the current txn
> */
> + SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
> +
> + SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == 1);
> +
> + /* Keep the txn name in pool */
> + SVN_ERR(svn_fs_txn_name(&txn_name, txn, pool));
> +
> + /* Close the transaction ... again. */
> + svn_pool_clear(subpool);
> +
> + /* Reopen the transaction by name ... again */
> + SVN_ERR(svn_fs_open_txn(&txn, fs, txn_name, subpool));
> +
> + /* Does it have the same name? ... */
> + SVN_ERR(svn_fs_txn_root(&root, txn, subpool));
> + SVN_TEST_STRING_ASSERT(svn_fs_txn_root_name(root, subpool),
> txn_name);
> +
> + /* And the same base revision? */
> + SVN_TEST_ASSERT(svn_fs_txn_base_revision(txn) == 1);
> +
> svn_pool_destroy(subpool);
>
> return SVN_NO_ERROR;
>
Received on 2015-11-25 23:27:58 CET

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