Stefan Fuhrmann wrote on Sun, Apr 03, 2011 at 20:00:28 +0200: > On 26.03.2011 06:31, Daniel Shahaf wrote: > >stef...@apache.org wrote on Sun, Mar 13, 2011 at 12:40:50 -0000: > >>URL: > >>http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/tree.c?rev=1081097&r1=1081096&r2=1081097&view=diff > >>============================================================================== > >>--- subversion/trunk/subversion/libsvn_fs_fs/tree.c (original) > >>+++ subversion/trunk/subversion/libsvn_fs_fs/tree.c Sun Mar 13 12:40:49 2011 > >>@@ -3916,7 +3916,9 @@ make_txn_root(svn_fs_root_t **root_p, > >> svn_fs_fs__dag_serialize, > >> svn_fs_fs__dag_deserialize, > >> APR_HASH_KEY_STRING, > >>- 32, 20, FALSE, root->pool)); > >>+ 32, 20, FALSE, > >>+ apr_pstrcat(pool, txn, ":TXN", (char > >>*)NULL), > >This doesn't use namespacing... > > > Name spaces are only required for membuffer caches. > This is a good ol' inprocess cache that will not share > cached information with other cache instances. >
If I understand correctly, in other words it's because membuffer caches are a singleton but "inprocess" caches are not --- and therefore, the ID needs to be unique only within the scope of this cache, rather than globally. Thanks for the explanation, Daniel > >So, beyond the theoretical problem, doesn't it mean that a single > >application that creates two repositories and begins a txn against each > >repository will mix the two txn's caches? (since txn names are > >predictable) > > > >IOW: shouldn't this use the PREFIX argument that caching.c uses? > Unless somebody reads the statistics info for this > cache instance, the id won't be used at all. If someone > should call svn_cache__get_info on that info for > profiling etc., the transaction name plus the ":TXN" > marker should be sufficient to identify the data > in a log, for instance. > >>+ root->pool)); > >> > >> root->fsap_data = frd; > >> > >> > >>Modified: subversion/trunk/subversion/tests/libsvn_subr/cache-test.c > >>URL: > >>http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/cache-test.c?rev=1081097&r1=1081096&r2=1081097&view=diff > >>============================================================================== > >>--- subversion/trunk/subversion/tests/libsvn_subr/cache-test.c (original) > >>+++ subversion/trunk/subversion/tests/libsvn_subr/cache-test.c Sun Mar 13 > >>12:40:49 2011 > >>@@ -136,6 +136,7 @@ test_inprocess_cache_basic(apr_pool_t *p > >> 1, > >> 1, > >> TRUE, > >>+ "", > >> pool)); > >> > >Same problem... (I imagine we might want to use "" in the cache > >infrastructure internally some day, for example) > This is also a cache_inprocess instance. So, we don't need > a proper ID / prefix here for proper function. > > -- Stefan^2. >