framework icon indicating copy to clipboard operation
framework copied to clipboard

Package_information property is misleading

Open matthiasdeblock opened this issue 7 years ago • 8 comments

The package information from a storagerouter is providing me an empty dict.

Function https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/generic.py#L275 is pointing to the function @ https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/update.py#L84 but this is not fetching the current packages as mentioned in the description of that function. Function @ https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/update.py#L65 is.

matthiasdeblock avatar Mar 14 '18 14:03 matthiasdeblock

My point here is that the hook to 'get_package_info_cluster' is missing in the GenericController. It was there in version 2.11.1: https://github.com/openvstorage/framework/blob/2.11.1/ovs/lib/generic.py#L599

It is also possible that something else got changed.

matthiasdeblock avatar Mar 14 '18 15:03 matthiasdeblock

This might also be an issue to update the cluster to bighorn-rc3 in the future.

matthiasdeblock avatar Mar 14 '18 15:03 matthiasdeblock

Intended as there are errors when retrieving this information

JeffreyDevloo avatar Mar 19 '18 13:03 JeffreyDevloo

There where no errors while retrieving this information on RC2. It should show the installed packages but it can never gather them as function refresh_package_information() (https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/generic.py#L275) is never gathering the installed packages. Function refresh_package_information() is pointing to https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/update.py#L84 but this one is not gathering the installed packages, only the candidate packages. Hook https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/update.py#L64 on the other hand should fetch the installed versions but this one is not called in refresh_package_information().

matthiasdeblock avatar Mar 19 '18 13:03 matthiasdeblock

The refresh package information only detects the changes of the packages. This is the result when checking to update towards fwk-develop from Bighorn-rc2:

{u'framework': {u'downtime': [[u'gui', None], [u'api', None]],
  u'packages': {u'openvstorage': {u'candidate': u'2.12.0-dev.1519906750.3201f93-1',
    u'installed': u'2.11.4-1'},
   u'openvstorage-backend': {u'candidate': u'1.12.0-dev.1519202962.286a148-1',
    u'installed': u'1.11.2-1'},
   u'openvstorage-extensions': {u'candidate': u'0.4.0-dev.1521464306.0dcf0fa-1',
    u'installed': u'0.3.2-1'}},
  u'prerequisites': [],
  u'services_post_update': {u'10': [], u'20': [u'ovs-support-agent']},
  u'services_stop_start': {u'10': [u'ovs-watcher-framework',
    u'ovs-watcher-framework'],
   u'20': [u'memcached', u'memcached']}},
 u'storagedriver': {u'downtime': [],
  u'packages': {u'volumedriver-ee-base': {u'candidate': u'6.17.2-0',
    u'installed': u'6.16.7-0'},
   u'volumedriver-ee-server': {u'candidate': u'6.17.2-0',
    u'installed': u'6.16.7-0'}},
  u'prerequisites': [],
  u'services_post_update': {u'10': [u'volumedriver_myvpool01'],
   u'20': [u'dtl_myvpool01']},
  u'services_stop_start': {u'10': [], u'20': []}}}

The flow that happens:

  • https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/generic.py#L275 -> invoked through the API
  • https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/update.py#L84 -> hook gets executed (fetched by https://github.com/openvstorage/framework/blob/2.11.4/ovs/lib/generic.py#L302)
  • https://github.com/openvstorage/framework-extensions/blob/0.3.2/src/packages/packagefactory.py#L145 -> Called by the hook. When a newer version is found: this will return {'candidate': .. 'installed': ...}

So the information could have been empty when no updates were to be done. If that is what this ticket is about, we'd need to adjust it. However for the update logic, this is just what we need

@matthiasdeblock Is the issue that the package information does not contain the current installed versions when no updates are found?

JeffreyDevloo avatar Mar 21 '18 12:03 JeffreyDevloo

Then I see 2 options:

  • make sure the output show the installed packages if all updates are applied
  • rename it to update_information...

matthiasdeblock avatar Mar 21 '18 13:03 matthiasdeblock

@wimpers Your decision

JeffreyDevloo avatar Mar 21 '18 13:03 JeffreyDevloo

I prefer option 1: always show installed packaged and if candidate packages exist, add them too. Set to minor but still want to fix it as it is confusing as hell.

wimpers avatar Mar 21 '18 14:03 wimpers