You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by gs...@apache.org on 2010/04/21 12:04:42 UTC

svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Author: gstein
Date: Wed Apr 21 10:04:42 2010
New Revision: 936240

URL: http://svn.apache.org/viewvc?rev=936240&view=rev
Log:
Revamp and simplify the central entry-fetching function,
svn_wc__get_entry. It no longer worries about the entries cache, and
always goes to the database to fetch the parent/entry pair of entries.

* subversion/libsvn_wc/entries.c:
  (svn_wc__get_entry): strip out the access baton and entries cacheing
    considerations from this function. use read_entry_pair to grab the
    target entry. only use the RESULT_POOL and SCRATCH_POOL rather than an
    access baton's pool.

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=936240&r1=936239&r2=936240&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Wed Apr 21 10:04:42 2010
@@ -1393,9 +1393,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
 {
   const char *dir_abspath;
   const char *entry_name;
-  svn_wc_adm_access_t *adm_access;
-  apr_hash_t *entries;
-  apr_pool_t *source_pool;
 
   /* Can't ask for the parent stub if the node is a file.  */
   SVN_ERR_ASSERT(!need_parent_stub || kind != svn_node_file);
@@ -1404,16 +1401,11 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                 kind, need_parent_stub, scratch_pool,
                                 scratch_pool));
 
-  /* Is there an existing access baton for this path?  */
-  adm_access = svn_wc__adm_retrieve_internal2(db, dir_abspath, scratch_pool);
-  if (adm_access == NULL)
     {
+      const svn_wc_entry_t *parent_entry;
       svn_error_t *err;
 
-      /* No access baton. Just read the entries into the scratch pool.
-         No place to cache them, so they won't stick around.
-
-         NOTE: if KIND is UNKNOWN and we decided to examine the *parent*
+      /* NOTE: if KIND is UNKNOWN and we decided to examine the *parent*
          directory, then it is possible we moved out of the working copy.
          If the on-disk node is a DIR, and we asked for a stub, then we
          obviously can't provide that (parent has no info). If the on-disk
@@ -1425,8 +1417,9 @@ svn_wc__get_entry(const svn_wc_entry_t *
          obstructed on-disk by some other node kind (NONE, FILE, UNKNOWN),
          then this will throw an error.  */
 
-      err = read_entries(&entries, db, dir_abspath,
-                         scratch_pool, scratch_pool);
+      err = read_entry_pair(&parent_entry, entry,
+                            db, dir_abspath, entry_name,
+                            result_pool, scratch_pool);
       if (err)
         {
           if (err->apr_err != SVN_ERR_WC_MISSING || kind != svn_node_unknown
@@ -1470,29 +1463,8 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                  svn_dirent_local_style(local_abspath,
                                                         scratch_pool));
         }
-
-      /* The entries are allocated in scratch_pool right now.  */
-      source_pool = scratch_pool;
-    }
-  else
-    {
-      /* We have a place to cache the results.  */
-
-      /* The entries are currently, or will be, allocated in the access
-         baton's pool.  */
-      source_pool = svn_wc_adm_access_pool(adm_access);
-
-      entries = svn_wc__adm_access_entries(adm_access);
-      if (entries == NULL)
-        {
-          /* See note above about reading the entries for an UNKNOWN.  */
-          SVN_ERR(read_entries(&entries, db, dir_abspath,
-                               source_pool, scratch_pool));
-          svn_wc__adm_access_set_entries(adm_access, entries);
-        }
     }
 
-  *entry = apr_hash_get(entries, entry_name, APR_HASH_KEY_STRING);
   if (*entry == NULL)
     {
       if (allow_unversioned)
@@ -1503,10 +1475,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
                                                       scratch_pool));
     }
 
-  /* Give the caller a valid entry.  */
-  if (result_pool != source_pool)
-    *entry = svn_wc_entry_dup(*entry, result_pool);
-
   /* The caller had the wrong information.  */
   if ((kind == svn_node_file && (*entry)->kind != svn_node_file)
       || (kind == svn_node_dir && (*entry)->kind != svn_node_dir))



Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Philip Martin <ph...@wandisco.com>.
Philip Martin <ph...@wandisco.com> writes:

> Philip Martin <ph...@wandisco.com> writes:
>
>> Greg Stein <gs...@gmail.com> writes:
>>
>>> With this change, our code no longer reads "all entries", nor does it
>>> attempt to cache that hash of entries.
>>>
>>> The only way to do so, is with svn_wc_entries_read(),
>>> svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
>>> and not used by trunk.
>>>
>>> Not seeing much of a performance gain, though. (I suspect SQLite
>>> caching was helping us before)
>>>
>>> Cheers,
>>> -g
>>>
>>> ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...
>>
>> A lot more than that here, e.g. basic_tests 1, 2, 3, 4, 5, 6, 7, 8, 9,
>> 10, 11, 12, 13, 14, 15, 16, 17, 23, 31, 32, 35, 38, 40 and 48 all
>> fail.  A typical failure is:
>
> This might be because 'svn status -u' now fails on the root of a
> working copy:

Yes.  svn_wc__get_entry now returns SVN_ERR_WC_NOT_DIRECTORY in cases
where it previously returned SVN_ERR_WC_MISSING.  This patch

Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c	(revision 936248)
+++ subversion/libsvn_wc/status.c	(working copy)
@@ -2401,6 +2401,7 @@
       err = svn_wc__get_entry(&parent_entry, db, parent_abspath, TRUE,
                               svn_node_dir, FALSE, scratch_pool, scratch_pool);
       if (err && (err->apr_err == SVN_ERR_WC_MISSING
+                  || err->apr_err == SVN_ERR_WC_NOT_DIRECTORY
                     || err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND
                     || err->apr_err == SVN_ERR_NODE_UNEXPECTED_KIND))
         {

reduces the number of errors but I guess there are other places that
need to change.

-- 
Philip

Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Greg Stein <gs...@gmail.com>.
On Wed, Apr 21, 2010 at 10:32, Greg Stein <gs...@gmail.com> wrote:
> On Wed, Apr 21, 2010 at 07:22, Philip Martin <ph...@wandisco.com> wrote:
>> Philip Martin <ph...@wandisco.com> writes:
>>
>>> Greg Stein <gs...@gmail.com> writes:
>>>
>>>> With this change, our code no longer reads "all entries", nor does it
>>>> attempt to cache that hash of entries.
>>>>
>>>> The only way to do so, is with svn_wc_entries_read(),
>>>> svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
>>>> and not used by trunk.
>>>>
>>>> Not seeing much of a performance gain, though. (I suspect SQLite
>>>> caching was helping us before)
>>>>
>>>> Cheers,
>>>> -g
>>>>
>>>> ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...
>>>
>>> A lot more than that here, e.g. basic_tests 1, 2, 3, 4, 5, 6, 7, 8, 9,
>>> 10, 11, 12, 13, 14, 15, 16, 17, 23, 31, 32, 35, 38, 40 and 48 all
>>> fail.  A typical failure is:
>>
>> This might be because 'svn status -u' now fails on the root of a
>> working copy:
>>
>> $ subversion/svn/svn co file://`pwd`/repo1 wc1
>> Checked out revision 0.
>> $ subversion/svn/svn st -u wc1
>> svn: warning: '/home/pm/sw/subversion/obj' is not a working copy
>>
>> but works if the working copy is inside another 1.7 working copy:
>>
>> $ subversion/svn/svn co file://`pwd`/repo1 wc1/wc2
>> Checked out revision 0.
>> $ subversion/svn/svn st -u wc1/wc2
>>    S            0   wc1/wc2
>> Status against revision:      0
>>
>> Greg, are you building and running your tests within a 1.7 source
>> tree?
>
> You bet. "svn" is trunk, baby!! :-P
>
> Let me dig into this...
>

There were a couple things, but it looks like r936970 fixed the last
of the issues.

Cheers,
-g

Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Greg Stein <gs...@gmail.com>.
On Wed, Apr 21, 2010 at 07:22, Philip Martin <ph...@wandisco.com> wrote:
> Philip Martin <ph...@wandisco.com> writes:
>
>> Greg Stein <gs...@gmail.com> writes:
>>
>>> With this change, our code no longer reads "all entries", nor does it
>>> attempt to cache that hash of entries.
>>>
>>> The only way to do so, is with svn_wc_entries_read(),
>>> svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
>>> and not used by trunk.
>>>
>>> Not seeing much of a performance gain, though. (I suspect SQLite
>>> caching was helping us before)
>>>
>>> Cheers,
>>> -g
>>>
>>> ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...
>>
>> A lot more than that here, e.g. basic_tests 1, 2, 3, 4, 5, 6, 7, 8, 9,
>> 10, 11, 12, 13, 14, 15, 16, 17, 23, 31, 32, 35, 38, 40 and 48 all
>> fail.  A typical failure is:
>
> This might be because 'svn status -u' now fails on the root of a
> working copy:
>
> $ subversion/svn/svn co file://`pwd`/repo1 wc1
> Checked out revision 0.
> $ subversion/svn/svn st -u wc1
> svn: warning: '/home/pm/sw/subversion/obj' is not a working copy
>
> but works if the working copy is inside another 1.7 working copy:
>
> $ subversion/svn/svn co file://`pwd`/repo1 wc1/wc2
> Checked out revision 0.
> $ subversion/svn/svn st -u wc1/wc2
>    S            0   wc1/wc2
> Status against revision:      0
>
> Greg, are you building and running your tests within a 1.7 source
> tree?

You bet. "svn" is trunk, baby!! :-P

Let me dig into this...

Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Philip Martin <ph...@wandisco.com>.
Philip Martin <ph...@wandisco.com> writes:

> Greg Stein <gs...@gmail.com> writes:
>
>> With this change, our code no longer reads "all entries", nor does it
>> attempt to cache that hash of entries.
>>
>> The only way to do so, is with svn_wc_entries_read(),
>> svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
>> and not used by trunk.
>>
>> Not seeing much of a performance gain, though. (I suspect SQLite
>> caching was helping us before)
>>
>> Cheers,
>> -g
>>
>> ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...
>
> A lot more than that here, e.g. basic_tests 1, 2, 3, 4, 5, 6, 7, 8, 9,
> 10, 11, 12, 13, 14, 15, 16, 17, 23, 31, 32, 35, 38, 40 and 48 all
> fail.  A typical failure is:

This might be because 'svn status -u' now fails on the root of a
working copy:

$ subversion/svn/svn co file://`pwd`/repo1 wc1
Checked out revision 0.
$ subversion/svn/svn st -u wc1
svn: warning: '/home/pm/sw/subversion/obj' is not a working copy

but works if the working copy is inside another 1.7 working copy:

$ subversion/svn/svn co file://`pwd`/repo1 wc1/wc2
Checked out revision 0.
$ subversion/svn/svn st -u wc1/wc2
    S            0   wc1/wc2
Status against revision:      0

Greg, are you building and running your tests within a 1.7 source
tree?

-- 
Philip

Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Philip Martin <ph...@wandisco.com>.
Greg Stein <gs...@gmail.com> writes:

> With this change, our code no longer reads "all entries", nor does it
> attempt to cache that hash of entries.
>
> The only way to do so, is with svn_wc_entries_read(),
> svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
> and not used by trunk.
>
> Not seeing much of a performance gain, though. (I suspect SQLite
> caching was helping us before)
>
> Cheers,
> -g
>
> ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...

A lot more than that here, e.g. basic_tests 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 23, 31, 32, 35, 38, 40 and 48 all
fail.  A typical failure is:

CMD: svn rm svn-test-work/working_copies/basic_tests-1/A/D/G --config-dir /home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.036079>
D         svn-test-work/working_copies/basic_tests-1/A/D/G/pi
D         svn-test-work/working_copies/basic_tests-1/A/D/G/rho
D         svn-test-work/working_copies/basic_tests-1/A/D/G/tau
D         svn-test-work/working_copies/basic_tests-1/A/D/G
CMD: svn status -v -u -q svn-test-work/working_copies/basic_tests-1 --config-dir /home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom
<TIME = 0.028362>
=============================================================
Expected '__SVN_ROOT_NODE' and actual '__SVN_ROOT_NODE' in status tree are different!
=============================================================
EXPECTED NODE TO BE:
=============================================================
 * Node name:   __SVN_ROOT_NODE
    Path:       __SVN_ROOT_NODE
    Contents:   N/A (node is a directory)
    Properties: {}
    Attributes: {}
    Children:   1
=============================================================
ACTUAL NODE FOUND:
=============================================================
 * Node name:   __SVN_ROOT_NODE
    Path:       __SVN_ROOT_NODE
    Contents:   None
    Properties: {}
    Attributes: {}
    Children:  None (node is probably a file)
Unequal Types: one Node is a file, the other is a directory



-- 
Philip

Re: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Greg Stein <gs...@gmail.com>.
With this change, our code no longer reads "all entries", nor does it
attempt to cache that hash of entries.

The only way to do so, is with svn_wc_entries_read(),
svn_wc_walk_entries3(), or svn_wc_entry(). All three are deprecated
and not used by trunk.

Not seeing much of a performance gain, though. (I suspect SQLite
caching was helping us before)

Cheers,
-g

ps. this breaks special_tests 12 and stat_tests 5. I'll fix after sleep...

On Wed, Apr 21, 2010 at 06:04,  <gs...@apache.org> wrote:
> Author: gstein
> Date: Wed Apr 21 10:04:42 2010
> New Revision: 936240
>
> URL: http://svn.apache.org/viewvc?rev=936240&view=rev
> Log:
> Revamp and simplify the central entry-fetching function,
> svn_wc__get_entry. It no longer worries about the entries cache, and
> always goes to the database to fetch the parent/entry pair of entries.
>
> * subversion/libsvn_wc/entries.c:
>  (svn_wc__get_entry): strip out the access baton and entries cacheing
>    considerations from this function. use read_entry_pair to grab the
>    target entry. only use the RESULT_POOL and SCRATCH_POOL rather than an
>    access baton's pool.
>
> Modified:
>    subversion/trunk/subversion/libsvn_wc/entries.c
>...

RE: svn commit: r936240 - /subversion/trunk/subversion/libsvn_wc/entries.c

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: gstein@apache.org [mailto:gstein@apache.org]
> Sent: woensdag 21 april 2010 12:05
> To: commits@subversion.apache.org
> Subject: svn commit: r936240 -
> /subversion/trunk/subversion/libsvn_wc/entries.c
> 
> Author: gstein
> Date: Wed Apr 21 10:04:42 2010
> New Revision: 936240
> 
> URL: http://svn.apache.org/viewvc?rev=936240&view=rev
> Log:
> Revamp and simplify the central entry-fetching function,
> svn_wc__get_entry. It no longer worries about the entries cache, and
> always goes to the database to fetch the parent/entry pair of entries.
> 
> * subversion/libsvn_wc/entries.c:
>   (svn_wc__get_entry): strip out the access baton and entries cacheing
>     considerations from this function. use read_entry_pair to grab the
>     target entry. only use the RESULT_POOL and SCRATCH_POOL rather than
> an
>     access baton's pool.

This patch breaks 485 tests on the ubuntu buildbot and 479 on the Windows buildbot.

(I see basic_tests.py 1-17 in the list of failures)

	Bert