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

Executing 'svn st' with stale wc.db workqueue doesn't fail in 1.9.x

From: Evgeny Kotkov <evgeny.kotkov_at_visualsvn.com>
Date: Tue, 12 May 2015 18:14:16 +0300

Subversion 1.9.0-rc1 changed the behavior of commands such as 'svn st'
in situations the wc.db workqueue is not empty, i.e., contains stale items.
These read-only commands no longer fail with SVN_ERR_WC_CLEANUP_REQUIRED:

  svn co https://svn.apache.org/repos/asf/subversion/trunk .
  sqlite3 .svn\wc.db "INSERT INTO work_queue (work) VALUES ('abc')"

  binaries-1.8.13\svn st
  svn: E155037: Previous operation has not finished; run 'cleanup' if it ...

  binaries-1.9.0-rc1\svn st
  (no output)

Non-readonly operations such as 'svn up' behave the same way in both versions
and fail with SVN_ERR_WC_CLEANUP_REQUIRED.

I am wondering whether this behavior is expected. As far as I realize, this is
a consequence of us fixing issue #4390, "parallel nested checkout not possible
with wc-ng" in r1501338 [1,2]. With this fix, the workqueue emptiness check
only occurs when the db is locked for writing, which is not the case of svn st.

From my reading of how this works, if the workqueue contains unprocessed items,
the state of wc.db is, strictly speaking, unknown. Hence, operations on the
database could potentially yield incomplete or incorrect results.

Any thoughts on this?

Here is a quick proof-of-concept test for this behavior:
[[[
Index: subversion/tests/cmdline/wc_tests.py
===================================================================
--- subversion/tests/cmdline/wc_tests.py (revision 1678956)
+++ subversion/tests/cmdline/wc_tests.py (working copy)
@@ -360,7 +360,20 @@ def checkout_within_locked_wc(sbox):
                                      [], "checkout", sbox.repo_url + '/A/B/E',
                                      sbox.ospath("nested-wc"))

+def status_stale_workqueue(sbox):
+ """status with stale workqueue items"""

+ sbox.build(read_only = True)
+
+ sbox.simple_mkdir('X')
+ svntest.actions.lock_admin_dir(sbox.ospath(''), True, True)
+ svntest.actions.run_and_verify_svn(None,
+ "svn: E155037: Previous operation has "
+ "not finished; run 'cleanup' if it was "
+ "interrupted",
+ 'status', sbox.ospath('X'))
+
+
 ########################################################################
 # Run the tests

@@ -384,6 +397,7 @@ test_list = [ None,
               cleanup_unversioned_items_in_locked_wc,
               cleanup_dir_external,
               checkout_within_locked_wc,
+ status_stale_workqueue,
              ]

 if __name__ == '__main__':

]]]

[1] http://subversion.tigris.org/issues/show_bug.cgi?id=4390
[2] https://svn.apache.org/r1501338

Regards,
Evgeny Kotkov
Received on 2015-05-12 17:22:14 CEST

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