three snapshots created

Bug #852458 reported by Nafallo Bjälevik on 2011-09-17
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
apt-btrfs-snapshot (Ubuntu)
Medium
Unassigned

Bug Description

 Hi,

It seems we get three snapshots created when ran from update-manager, but only one when used with apt-get manually from the terminal. Not sure how to help debug it, but let me know how and I'll try my best to make the effort.

nafallo@parakeet:~$ sudo apt-btrfs-snapshot list | tail -n5
@apt-snapshot-old-root-2011-09-17_09:40:37
@apt-snapshot-2011-09-17_09:53:36
@apt-snapshot-2011-09-17_09:53:46
@apt-snapshot-2011-09-17_09:53:56
@apt-snapshot-2011-09-17_10:19:14

Cheers, /N

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: apt-btrfs-snapshot 0.2
ProcVersionSignature: Ubuntu 3.0.0-11.18-generic 3.0.4
Uname: Linux 3.0.0-11-generic i686
NonfreeKernelModules: wl
ApportVersion: 1.23-0ubuntu1
Architecture: i386
Date: Sat Sep 17 10:27:01 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_GB:en
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: apt-btrfs-snapshot
UpgradeStatus: Upgraded to oneiric on 2011-08-23 (24 days ago)

Nafallo Bjälevik (nafallo) wrote :
Changed in apt-btrfs-snapshot (Ubuntu):
importance: Undecided → Low
Nafallo Bjälevik (nafallo) wrote :

Oh, should probably mention this isn't a regression. I've always seen the issue since I installed the package. Just neglected to actually report the bug until now.

Michael Vogt (mvo) on 2011-09-27
Changed in apt-btrfs-snapshot (Ubuntu):
importance: Low → Medium
status: New → Confirmed
MatthewHawn (steamraven) wrote :

I have witnessed this too. This actually becomes a problem if it is called more than once in the same second: apt-btrfs-snapshot discards the microsecond when creating the snapshot name. Since the subvolume (snapshot) already exists on the second call, btrfs dumps the second snapshot WITHIN the first.

This creates something like:

sudo btrfs subvolume list -p .

ID 256 parent 5 top level 5 path @
ID 305 parent 5 top level 5 path @apt-snapshot-2012-06-20_09:33:18
ID 306 parent 305 top level 5 path @apt-snapshot-2012-06-20_09:33:18/@

This will prevent @apt-snapshot-2012-06-20_09:33:18 from being deleted because it has a child subvolume. This might cause: Bug # #997909.

I am not sure what happens if more than two snapshots happen in the same second. I would assume the third would fail looking like: #853849

Simple solutions: keep the microseconds or add a random (or incrementing ) postfix

Sanjeev Gupta (ghane) wrote :

I can confirm this:

root@precise-X201:~# btrfs subvolume list -p /
ID 256 parent 5 top level 5 path @
ID 269 parent 5 top level 5 path @apt-snapshot-2012-02-06_10:57:25
ID 270 parent 269 top level 5 path @apt-snapshot-2012-02-06_10:57:25/@
ID 271 parent 5 top level 5 path @apt-snapshot-2012-02-06_10:57:26
ID 272 parent 271 top level 5 path @apt-snapshot-2012-02-06_10:57:26/@
ID 282 parent 5 top level 5 path @apt-snapshot-2012-02-07_10:39:29
ID 283 parent 282 top level 5 path @apt-snapshot-2012-02-07_10:39:29/@
ID 302 parent 5 top level 5 path @apt-snapshot-2012-02-21_11:31:14
ID 303 parent 302 top level 5 path @apt-snapshot-2012-02-21_11:31:14/@
ID 440 parent 5 top level 5 path @apt-snapshot-2012-04-23_14:12:51
ID 441 parent 440 top level 5 path @apt-snapshot-2012-04-23_14:12:51/@
ID 443 parent 5 top level 5 path @apt-snapshot-2012-05-02_12:56:59
ID 444 parent 443 top level 5 path @apt-snapshot-2012-05-02_12:56:59/@

Sanjeev Gupta (ghane) wrote :

Hi,

Please see
  http://www.ogre.com/node/413
for a work-around.

I came here to report the nested snapshot problem also.

It means the affected snapshots must be deleted manually.

I wouldn't tag this bug with a medium priority as in the actual state apt-btrfs is broken and potentially harmful.

But what's really disturbing here is that while this error was reported almost a year ago apt-btrfs is still shipped in its current dangerous state!

I wonder what is Ubuntu/Canonical policy about shipping a broken administrative tool that can potentially disrupt a production environment.

If there isn't a tag-line for a fix apt-btrfs should at least be removed from the official repositories until it is working as expected again, we are talking here about a system-level bug, not a fancy GUI one that could be annoying but doesn't jeopardize user's data.

My 2c...
Regards!

adrian (addrian20) wrote :

The problem is that aptdaemon invokes dpkg three times, as mentioned in the dpkg manual
http://manpages.ubuntu.com/manpages/trusty/man1/dpkg.1.html
"Note: front-ends might call dpkg several times per invocation, which might run the hooks more times than expected."

My very ugly workaround is to check if any snapshot has been made within the last 60 seconds. I'm attaching my modified /etc/apt/apt.conf.d/80-btrfs-snapshot

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers