A patch for collecting swap utilization in openvz

Bug #1372750 reported by Ivan Kurnosov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
collectd (Ubuntu)
Fix Released
Low
Unassigned
Trusty
Fix Released
Low
Marius Gedminas

Bug Description

[Impact]

* Any users of collectd that run Ubuntu 14.04 LTS in an OpenVZ container will no longer be able to track swap usage. This is a regression from Ubuntu 12.04 LTS

[Test Case]

* Get yourself an OpenVC container with some enabled swap space

* sudo apt-get install collectd

* Let it run for a few minutes

* ls /var/lib/collectd/rrd/*/swap/

You should see four files there: swap-free.rrd swap_io-in.rrd swap_io-out.rrd swap-used.rrd

If you see only two (swap_io-in.rrd swap_io-out.rrd), then you're affected by this bug

[Regression Potential]

* I see no way this could end badly ;)

* I've backported the upstream patch to a package in my PPA (ppa:pov), and have been running it since November 2015.

[Other Info]

* The upstream bug is https://github.com/collectd/collectd/issues/733. It has a fix in master for the upcoming 5.5.0 release at https://github.com/collectd/collectd/commit/8b618e1fb63ca5f8c741e95651bc41cf6e454588, and a smaller fix suitable for backporting for older versions (since 5.3.x) at https://github.com/collectd/collectd/commit/1a146775d42a15202cba4e19c0fcda465705bcb8.

[Original Bug Report]

In collectd-5.4.0-3ubuntu2 there is a bug that prevents collectd from collecting information about swap utilization.

Here is a corresponding issue on github: https://github.com/collectd/collectd/issues/733

Also the developer provided the minimalistic patch that fixes the issue and would be applicable for 5.4.0: https://github.com/collectd/collectd/commit/1a146775d42a15202cba4e19c0fcda465705bcb8

PS: forwarded from https://answers.launchpad.net/ubuntu/+source/collectd/+question/254877

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in collectd (Ubuntu):
status: New → Confirmed
Revision history for this message
Marius Gedminas (mgedmin) wrote :

This is a regression: swap tracking worked in Ubuntu 12.04 LTS.

I intend to prepare a debdiff and ask for a SRU as per https://wiki.ubuntu.com/StableReleaseUpdates, if time permits.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Upstream fix went into 5.5.0, according to git tags on https://github.com/collectd/collectd/commit/8b618e1fb63ca5f8c741e95651bc41cf6e454588.

Debian testing has collectd 5.5.0.

Ubuntu xenial is still on 5.4.1, so is, in theory, affected by this bug. (I don't have a spare OpenVZ container to test -- I'm renting these containers as cheap VPSes from a local provider.)

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Meanwhile here's a debdiff.

I'm uploading the patched package into ppa:pov for testing.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I overlooked debian/patches/00list in my first attempt.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Confirming that collectd 5.4.0-3ubuntu2pov2 from ppa:pov (i.e. the corrected debdiff) fixes this problem for me.

https://launchpad.net/~pov/+archive/ubuntu/ppa/+packages?field.name_filter=collectd&field.status_filter=published&field.series_filter=

Now, before this can be SRUd to trusty, it needs to be fixed in xenial.

Revision history for this message
Marius Gedminas (mgedmin) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-swap-on-openvz.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Ivan Kurnosov (zerkms) wrote :

@mgedemin

Marius that's great, thank you.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your work, the change looks good but for a SRU you need description of the impact/test case/regression potential (see https://wiki.ubuntu.com/StableReleaseUpdates).

Also the issue should be fixed in the current serie before being backported (either by merging the new version from debian or by applying a similar patch to the current source)

Changed in collectd (Ubuntu):
importance: Undecided → Low
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Yes, it's premature: I didn't realize that checking the [x] patch checkbox on the attachment would subscribe ubuntu-sponsors! Sorry about the noise.

Mathew Hodson (mhodson)
tags: added: trusty
Revision history for this message
Michael Terry (mterry) wrote :
Download full text (5.5 KiB)

This bug was fixed in the package collectd - 5.5.0-4

---------------
collectd (5.5.0-4) unstable; urgency=medium

  * debian/collectd-core.overrides:
    - Update 'binary-or-shlib-defines-rpath' lintian override.
  * debian/rules:
    - Strip out non-deterministic bits out of generated jar files.
    - Remove RTLD_GLOBAL workaround, which was fixed upstream.
  * debian/patches:
    - Add bts802249_varnish_41.patch (Closes: #802249)

 -- Marc Fournier <email address hidden> Mon, 16 Nov 2015 21:03:31 +0100

collectd (5.5.0-3) unstable; urgency=medium

  * debian/rules, debian/control:
    - Avoid hiding compiler options at build time, allowing the buildd log
      scanner to do it's job.
    - Disable smart plugin on non-linux platforms, due to missing
      libatasmart-dev build-dependency.
  * debian/collectd-core.overrides:
    - Update 'capitalization-error-in-description' lintian override.
  * debian/rules, debian/collectd-core.collectd.service:
    - Rename systemd service file to collectd-core.collectd.service, to honour
      debhelper's naming convention.
  * debian/collectd-core.collectd.service:
    - Check for configuration file presence before starting the daemon.
    - Check for configuration file validity before starting the daemon.
  * debian/control, debian/changelog:
    - Update my email address to match identity of current GPG key.

 -- Marc Fournier <email address hidden> Sun, 13 Sep 2015 21:42:53 +0200

collectd (5.5.0-2) unstable; urgency=low

  * debian/rules:
    - Disable the turbostat plugin on !amd64,!i386; it's Intel-hardware
      specific.

 -- Sebastian Harl <email address hidden> Sun, 23 Aug 2015 15:35:26 +0200

collectd (5.5.0-1) unstable; urgency=medium

  [ Marc Fournier ]
  * New upstream release:
    - Battery plugin now prefers sysfs over (the deprecated) procfs for
      reading values; thanks to Witold Baryluk for reporting this
      (Closes: #630337).
    - The configuration supports unquoted IPv6 addresses now; thanks to Geoff
      Crompton for reporting this (Closes: #632713).
    - Fixed a FTBFS using clang; thanks to Arthur Marble for reporting this
      and providing a patch (Closes: #758481).
    - collection.cgi now supports the df_complex types; thanks to Joel Franco
      Guzmán for reporting this (Closes: #739625).
    - Fixed an off-by-one error in the AVL tree implementation that broke
      setups using only one threshold definition; thanks to Alexander Golovko
      for reporting this (Closes: #754230).
    - The disk plugin now (optionally) supports instance names based on a udev
      attribute; thanks to Trent W. Buck for reporting this (Closes: #632936).
  * debian/patches:
    - Removed bts559801_plugin_find_fix.dpatch; merged upstream.
    - Removed bts747093_lvm_segfault.dpatch; merged upstream.
    - Removed bts750440_config_segfault.dpatch; merged upstream.
    - Removed bts770681_riemann_ack.dpatch; merged upstream.
    - Removed bts770683_curl_init.dpatch; merged upstream.
    - Removed bts770688_snmp_memleak.dpatch; merged upstream.
    - Removed bts770690_java_jni_thread_detach.dpatch; merged upstream.
    - Removed bts770693_timestamps.dpatch; merged upstream.
    - Removed bts770694...

Read more...

Changed in collectd (Ubuntu):
status: Confirmed → Fix Released
Mathew Hodson (mhodson)
Changed in collectd (Ubuntu Trusty):
importance: Undecided → Low
Revision history for this message
Iain Lane (laney) wrote :

I uploaded this to trusty's queue, thanks!

I'm not sure if the SRU team will like the description though - if I were you I'd update it to clearly state the required information.
  https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

Changed in collectd (Ubuntu Trusty):
status: New → In Progress
assignee: nobody → Marius Gedminas (mgedmin)
Revision history for this message
Marius Gedminas (mgedmin) wrote :

This is the first time I'm proposing an SRU. I've updated the description -- what should I do next? Unassign myself? Subscribe ubuntu-sponsors again?

description: updated
Revision history for this message
Mathew Hodson (mhodson) wrote :

The package is in the upload queue. You can see it at https://launchpad.net/ubuntu/trusty/+queue?queue_state=1

There should be a post in this thread when it is released into trusty-proposed. Then the fix will need to be verified so that it can move into trusty-updates.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ivan, or anyone else affected,

Accepted collectd into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/collectd/5.4.0-3ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in collectd (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Ivan Kurnosov (zerkms) wrote :

I can confirm that the bug is fixed in the 5.4.0-3ubuntu2.1

Thank you

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package collectd - 5.4.0-3ubuntu2.1

---------------
collectd (5.4.0-3ubuntu2.1) trusty; urgency=medium

  * debian/patches:
    - Added swap_in_openvz.dpatch: Fix swap tracking in OpenVZ (LP: #1372750).

 -- Marius Gedminas <email address hidden> Tue, 03 Nov 2015 14:49:47 +0200

Changed in collectd (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for collectd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.