openSUSE / openSUSE/snapper

Incorrect status/diff output

Open
#321 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
1.2k
Forks
160
Avg merge
5d 18h
Merged PRs (30d)
3

Description

System information:

root@ubuntu:/# uname -a
Linux ubuntu 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 
root@ubuntu:/# snapper --version
snapper 0.4.1
flags btrfs,lvm,ext4,xattrs,rollback,btrfs-quota,no-selinux

The problem is that sometimes when the user creates/deletes folders and moves files around, snapper can become confused what the changes between two snapshots are.

Here are the contents of the two problematic snapshots:

root@ubuntu:/# sh -c 'cd /mnt/shared/.snapshots/43/snapshot; find .'
.
./.snapshots
./a
./a/Lake McDonald.jpg
./a/d
./a/d/173.jpg
./b

root@ubuntu:/# sh -c 'cd /mnt/shared/.snapshots/47/snapshot; find .'
.
./.snapshots
./d
./d/173.jpg
./d/Lake McDonald.jpg
./d/Lake Tahoe Colors.jpg
./b

snapper output:

root@ubuntu:~# snapper list
Type   | #  | Pre # | Date                            | User | Cleanup  | Description | Userdata
-------+----+-------+---------------------------------+------+----------+-------------+---------
single | 0  |       |                                 | root |          | current     |
single | 22 |       | Tue 24 Jan 2017 12:00:08 PM EET | root | timeline | timeline    |
single | 43 |       | Tue 24 Jan 2017 12:14:28 PM EET | root |          |             |
single | 47 |       | Tue 24 Jan 2017 12:15:03 PM EET | root |          |             |
single | 48 |       | Tue 24 Jan 2017 12:15:18 PM EET | root |          |             |

root@ubuntu:/# snapper status 43..47
+..... /mnt/shared/b/b/d/Lake McDonald.jpg
-..... /mnt/shared/b/Lake McDonald.jpg
+..... /mnt/shared/d/Lake Tahoe Colors.jpg

root@ubuntu:/# snapper diff 43..47
/usr/bin/diff: /mnt/shared/.snapshots/43/snapshot/b/b/d/Lake McDonald.jpg: No such file or directory
/usr/bin/diff: /mnt/shared/.snapshots/47/snapshot/b/b/d/Lake McDonald.jpg: No such file or directory
/usr/bin/diff: /mnt/shared/.snapshots/43/snapshot/b/Lake McDonald.jpg: No such file or directory
/usr/bin/diff: /mnt/shared/.snapshots/47/snapshot/b/Lake McDonald.jpg: No such file or directory
Binary files /mnt/shared/.snapshots/43/snapshot/d/Lake Tahoe Colors.jpg and /mnt/shared/.snapshots/47/snapshot/d/Lake Tahoe Colors.jpg differ

What is incorrect here:

  • status line 1: no such path exists
  • status line 2: no such path exists
  • diff line 5: path in snapshot 43 does not exist

I tested sending the same incremental snapshot using btrfs send/receive and the result looked ok to me, and it makes me believe this is an issue with snapper. I can provide the original btrfs disk image (~8MB compressed) if needed for further debugging.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing snapper status 43..47 and snapper diff 43..47 against the two snapshot trees under /mnt/shared/.snapshots/43/snapshot and /mnt/shared/.snapshots/47/snapshot. Compare each reported path with the find . listings; done means status and diff reference only paths that exist and accurately describe the changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.