[update] OpenStack Patching : puppet's versioncmp behaves wrong

Bug #1342041 reported by Ihor Kalnytskyi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Critical
Dmitry Ilyin
5.0.x
Fix Committed
Critical
Dmitry Ilyin

Bug Description

OpenStack Patching fails due to wrong `Puppet::Util::Package.versioncmp` comparison - yum is called with `-y downgrade` option.

    https://github.com/stackforge/fuel-library/blob/master/deployment/puppet/package/lib/puppet/provider/package/yum.rb#L121

Example of incorrect behaviour (ruby interactive shell):

    http://paste.openstack.org/show/86532/

In the snippet above we can see that more higher version is detected as more smaller version.

Solutions:

1/ Rewrite our versioncmp function to be more smart.

2/ Change package version notation.

Changed in fuel:
milestone: none → 5.1
Changed in fuel:
status: Confirmed → Triaged
Changed in fuel:
assignee: Fuel Library Team (fuel-library) → Bogdan Dobrelya (bogdando)
Revision history for this message
Dmitry Ilyin (idv1985) wrote :

Actually it's not really a versioncmp bug.

Puppet::Util::Package.versioncmp('2014.1.fuel5.0-mira4', '2014.1.1.fuel5.1-mira0')
=> 1

But first is lower then second and it should be -1

["2014", ".", "1", ".", "fuel", "5", ".", "0", "-", "mira", "4"]
["2014", ".", "1", ".", "1", ".", "fuel", "5", ".", "1", "-", "mira", "0"]
2014 vs 2014
. vs .
1 vs 1
. vs .
fuel vs 1
1

See? there are two 1's instead of one in the newer version. But it should be like this:
["2014", ".", "1", ".", "fuel", "5", ".", "0", "-", "mira", "4"]
["2014", ".", "1", ".", "fuel", "5", ".", "1", "-", "mira", "0"]
2014 vs 2014
. vs .
1 vs 1
. vs .
fuel vs fuel
5 vs 5
. vs .
0 vs 1
-1

So we should just rename package from 2014.1.1.fuel5.1-mira0 to 2014.1.fuel5.1-mira0

Dmitry Ilyin (idv1985)
Changed in fuel:
status: Triaged → Invalid
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Ok, but the issue isn't invalid. How to fix that - another question. But it still presence and we need to fix it in order to deliver openstack patching.

Changed in fuel:
status: Invalid → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (master)

Fix proposed to branch: master
Review: https://review.openstack.org/106997

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Bogdan Dobrelya (bogdando) wrote : Re: OpenStack Patching : puppet's versioncmp behaves wrong

Note that the patch implies hardcoded separation between MOS <-> Fuel versioning patterns based on the 'fuel' separator. Omitting that one would be destructive.

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

If we wanted rollback to 5.0.1 feature be possible, we would have wanted this as 5.0.1 backport as well.

Dmitry Ilyin (idv1985)
summary: - OpenStack Patching : puppet's versioncmp behaves wrong
+ [update] OpenStack Patching : puppet's versioncmp behaves wrong
Evgeniy L (rustyrobot)
tags: added: upgrade
removed: update
Revision history for this message
Dmitry Borodaenko (angdraug) wrote :

Latest comment in the linked review:

"It does help with CentOS but doesn't help with Ubuntu.

I guess we need to fix this on the package level."

indicates that this is a packaging problem.

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :
Changed in fuel:
assignee: Bogdan Dobrelya (bogdando) → Dmitry Ilyin (idv1985)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (master)

Change abandoned by Bogdan Dobrelya (<email address hidden>) on branch: master
Review: https://review.openstack.org/106997

Changed in fuel:
assignee: Dmitry Ilyin (idv1985) → Bogdan Dobrelya (bogdando)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/5.0)

Fix proposed to branch: stable/5.0
Review: https://review.openstack.org/111010

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (master)

Reviewed: https://review.openstack.org/106997
Committed: https://git.openstack.org/cgit/stackforge/fuel-library/commit/?id=004ab7ed0e6e4268f3657d47836d3629f339bd9a
Submitter: Jenkins
Branch: master

commit 004ab7ed0e6e4268f3657d47836d3629f339bd9a
Author: Bogdan Dobrelya <email address hidden>
Date: Tue Jul 15 14:08:46 2014 +0300

    Compare Fuel versions as well as MOS ones

    * Add rspec test cases for tricky and usual version formats, e.g.
      tricky: '2014.1.fuel5.0-mira4' vs '2014.1.1.fuel5.1-mira0'
      usual: '2014.1.fuel5.0-mira4' vs '2014.1.fuel5.1-mira0'
      (both for downgrading and installing cases)
    * Make a yum downgrade decision based BOTH onto MOS versions and
      Fuel versions comparsion results instead of full MOSt versions
      ('fuel' hardcoded as a separator for MOS and Fuel versions in MOSt)

    Closes-bug: #1342041

    Change-Id: Icacec5ed01510ab526a4b0e6092efdf203a6a2cb
    Signed-off-by: Bogdan Dobrelya <email address hidden>

Changed in fuel:
status: In Progress → Fix Committed
Changed in fuel:
status: Fix Committed → Confirmed
assignee: Bogdan Dobrelya (bogdando) → Dmitry Ilyin (idv1985)
Revision history for this message
Dmitry Ilyin (idv1985) wrote :
Changed in fuel:
status: Confirmed → Fix Committed
Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

Move in proggress ащк 5.0.x according review is not merged yet

Changed in fuel:
status: Fix Committed → In Progress
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (stable/5.0)

Reviewed: https://review.openstack.org/111010
Committed: https://git.openstack.org/cgit/stackforge/fuel-library/commit/?id=50ac798300f305db6c64a4bb8007fff25656826f
Submitter: Jenkins
Branch: stable/5.0

commit 50ac798300f305db6c64a4bb8007fff25656826f
Author: Bogdan Dobrelya <email address hidden>
Date: Tue Jul 15 14:08:46 2014 +0300

    Compare Fuel versions as well as MOS ones

    * Add rspec test cases for tricky and usual version formats, e.g.
      tricky: '2014.1.fuel5.0-mira4' vs '2014.1.1.fuel5.1-mira0'
      usual: '2014.1.fuel5.0-mira4' vs '2014.1.fuel5.1-mira0'
      (both for downgrading and installing cases)
    * Make a yum downgrade decision based BOTH onto MOS versions and
      Fuel versions comparsion results instead of full MOSt versions
      ('fuel' hardcoded as a separator for MOS and Fuel versions in MOSt)

    Closes-bug: #1342041

    Change-Id: Icacec5ed01510ab526a4b0e6092efdf203a6a2cb
    Signed-off-by: Bogdan Dobrelya <email address hidden>

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.