LR should not touch the hashes of non-existant MD

Bug #807737 reported by Facundo Batista on 2011-07-08
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Status tracked in Trunk
Stable-1-6
Critical
Facundo Batista
Stable-2-0
Critical
Facundo Batista
Stable-3-0
Critical
Facundo Batista
Trunk
Critical
Facundo Batista
ubuntuone-client (Ubuntu)
High
dobey
Natty
High
dobey
Oneiric
High
dobey
Precise
High
dobey

Bug Description

When in UDF mode, LR intercepts deletions, and as part of the process it dirties the parent hashes... but the parent may not exist.

Patch proposed:

=== modified file 'ubuntuone/syncdaemon/local_rescan.py'
--- ubuntuone/syncdaemon/local_rescan.py 2011-04-05 19:33:06 +0000
+++ ubuntuone/syncdaemon/local_rescan.py 2011-07-08 21:00:52 +0000
@@ -672,8 +672,11 @@
             fsm = self.fsm
             for evtname, path in delete_events:
                 parentpath = os.path.dirname(path)
- log_info("UDF mode! Resetting hashes to dir %r", parentpath)
- self.fsm.set_by_path(parentpath, local_hash="", server_hash="")
+ if self.fsm.has_metadata(path=parentpath):
+ log_info("UDF mode! Resetting hashes to dir %r",
+ parentpath)
+ self.fsm.set_by_path(parentpath,
+ local_hash="", server_hash="")
                 if evtname == "FS_DIR_DELETE":
                     log_info("UDF mode! Removing metadata from dir %r", path)
                     tree = fsm.get_paths_starting_with(path, include_base=True)

---------

TEST CASE:

Run these commands to setup the tests:
mkdir ~/Ubuntu\ One/807737 ~/Ubuntu\ One/807737/a ~/Ubuntu\ One/807737/a/b ~/Ubuntu\ One/807737/aa
(Wait a minute for Ubuntu One to pickup these new folders)
u1sdtool -q
rm -r ~/Ubuntu\ One/807737/a
u1sdtool -c

Result: ~/Ubuntu\ One/807737/a and ~/Ubuntu\ One/807737/aa are deleted

Expected result: Only ~/Ubuntu\ One/807737/a is deleted

Related branches

Facundo Batista (facundo) wrote :

Setting to high because makes SD stuck there.

Changed in ubuntuone-client:
importance: Undecided → High
assignee: nobody → Ubuntu One Foundations+ team (ubuntuone-foundations+)
Changed in ubuntuone-client:
status: Confirmed → Triaged
assignee: Ubuntu One Foundations+ team (ubuntuone-foundations+) → Facundo Batista (facundo)
status: Triaged → In Progress
Facundo Batista (facundo) wrote :

This should not be happening. If the node exists in metadata (it exists, as it's found in metadata and not in disk, which triggers the deletion that is captured because udf mode), its parent must exist, so the hashes should be able to be changed.

I'm still investigating what can cause this, but circumventing the error surely is not the solution.

Facundo Batista (facundo) wrote :

Set it to critical, as this can trigger false deletion in corner cases like the following:

Let's say you have these paths in your system:

  a/b/c
  a/b/d
  a/boo
  a/c

and having SD stopped, you remove "a/b", LR will inform the deletion of a/b/c, a/b/d, and a/boo (the later is wrong!).

Changed in ubuntuone-client:
importance: High → Critical
tags: added: u1-natty-sru
Changed in ubuntuone-client (Ubuntu):
importance: Undecided → High
description: updated
Changed in ubuntuone-client (Ubuntu Oneiric):
milestone: none → oneiric-updates
assignee: nobody → Rodney Dawes (dobey)
tags: added: u1-oneiric-sru
dobey (dobey) on 2011-10-11
Changed in ubuntuone-client (Ubuntu Natty):
assignee: nobody → Rodney Dawes (dobey)
importance: Undecided → High
status: New → In Progress

Hello Facundo, or anyone else affected,

Accepted ubuntuone-client into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ubuntuone-client (Ubuntu Oneiric):
status: New → Fix Committed
tags: added: verification-needed
Martin Pitt (pitti) wrote :

Hello Facundo, or anyone else affected,

Accepted ubuntuone-client into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ubuntuone-client (Ubuntu Natty):
status: In Progress → Fix Committed
description: updated
Joshua Hoover (joshuahoover) wrote :

Test passed on Natty using ubuntuone-client 1.6.2-0ubuntu2

Roman Yepishev (rye) wrote :

Test passed on Oneiric with ubuntuone-client 2.0.0-0ubuntu2

description: updated
tags: added: verification-done
removed: verification-needed
dobey (dobey) on 2011-10-13
Changed in ubuntuone-client (Ubuntu Natty):
milestone: none → natty-updates
Changed in ubuntuone-client (Ubuntu Precise):
milestone: none → precise-alpha-1
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntuone-client - 2.0.0-0ubuntu2

---------------
ubuntuone-client (2.0.0-0ubuntu2) oneiric-proposed; urgency=low

  * debian/patches/01_getnodebyid_fix.patch:
    - Fix filter by share and path (LP: #807737)
 -- Rodney Dawes <email address hidden> Tue, 11 Oct 2011 14:59:28 -0400

Changed in ubuntuone-client (Ubuntu Precise):
status: New → Fix Released
Changed in ubuntuone-client (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntuone-client - 1.6.2-0ubuntu2

---------------
ubuntuone-client (1.6.2-0ubuntu2) natty-proposed; urgency=low

  * debian/patches/01_getnodebyid_fix.patch:
    - Fix filter by share and path (LP: #807737)
 -- Rodney Dawes <email address hidden> Tue, 11 Oct 2011 15:42:40 -0400

Changed in ubuntuone-client (Ubuntu Natty):
status: Fix Committed → Fix Released
dobey (dobey) on 2011-12-21
Changed in ubuntuone-client (Ubuntu Precise):
assignee: nobody → Rodney Dawes (dobey)
importance: Undecided → High
milestone: precise-alpha-1 → precise-alpha-2
tags: removed: u1-oneiric-sru
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers