Re: svn commit: r1294479 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
From: Daniel Shahaf <danielsh_at_elego.de>
Date: Tue, 28 Feb 2012 10:30:47 +0200
danielsh_at_apache.org wrote on Tue, Feb 28, 2012 at 06:23:29 -0000:
Having had another look at this, I'm not sure to what extent that is
---
All caches live in fs_fs_data_t. The cache prefix embeds the UUID and
the OS path to the filesystem root (/srv/svn/repos/calc/db, or so) (see
svn_fs_fs__initialize_caches()).
The cache types are three: 'inprocess', 'membuffer', or 'memcache'. The
first two are per-process, but the third need not be.
The net result of all this is that verify() cannot be sure that, if it
got a cached data, it is a cache of information computed from the
repository it is interrogating: in memcache situations the information
may have been installed in the cache by another memcache client (running
on a different box), and even in in-process situations the following
scenario would invalidate the cache:
% svnadmin dump repos > backup.dump
% vi repos
% svnadmin is-repos-corrupt repos
yes
% svnadmin create repos2
% svnadmin load -q repos2 < backup.dump
% mv repos rm && mv repos2 repos
(And no, I don't think it's contrived. I imagine that's a fairly common
thing to do --- to restore a backup repository to its original name.)
---
So, I'm debating between:
- Disable all caches in svn_fs_verify().
- Disable memcached caches in svn_fs_verify().
- None of the above, but document that users of svn_fs_verify() should
disable caches. (And do that in libsvn_repos and/or 'svnadmin verify',
too.)
Thoughts?
> + */
> + svn_fs_id_t *root_id;
> + node_revision_t *root_noderev;
> +
> + if ((i % 100) == 0) /* uneducated guess */
> + svn_pool_clear(iterpool);
> +
> + /* Fetch ROOT_NODEREV. */
> + SVN_ERR(svn_fs_fs__rev_get_root(&root_id, fs, i, iterpool));
> + SVN_ERR(svn_fs_fs__get_node_revision(&root_noderev, fs, root_id,
> + iterpool));
> +
> + /* Check correctness. (Compare validate_root_noderev().) */
> + if (1+predecessor_predecessor_count != root_noderev->predecessor_count)
> + return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
> + _("predecessor count for "
> + "the root node-revision is wrong: "
> + "r%ld has %d, but r%ld has %d"),
> + i, root_noderev->predecessor_count,
> + i-1, predecessor_predecessor_count);
> +
> + predecessor_predecessor_count = root_noderev->predecessor_count;
> + }
> + }
> +
> + svn_pool_destroy(iterpool);
> return SVN_NO_ERROR;
> }
>
>
>
Received on 2012-02-28 09:32:39 CET
|
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.