sous-chefs / mysql

Development repository for the mysql cookbook
https://supermarket.chef.io/cookbooks/mysql
Apache License 2.0
338 stars 690 forks source link

Package upgrade hangs as long as service is running #481

Closed klyonrad closed 7 years ago

klyonrad commented 8 years ago

Cookbook version

7.2.0

Chef-client version

12.9.41

Platform Details

Ubuntu 14

Scenario:

Minor version Upgrade the mysql-server

Steps to Reproduce:

install an older package version by provisioning with the following configuration:

mysql_service 'default' do
  instance 'default'
  bind_address node['mysql']['bind_address']
  port node['mysql']['port']
  version '5.5'
  package_version '5.5.35+dfsg-1ubuntu1'
  package_action :install
  error_log '/var/log/mysql/error.log'
  socket '/var/run/mysqld/mysqld.sock' unless node['platform_version'].to_f >= 16.04
  pid_file '/var/run/mysqld/mysqld.pid' unless node['platform_version'].to_f >= 16.04
  action [:create, :start]
end

and after provisioning delete package_version line and set package_action :upgrade (or run aptitude upgrade mysql-server-5.5

Expected Result:

A successfull package upgrade run for mysql-server package.

Actual Result:

The upgrade process hangs. Upgrading only works when the process is stopped manually (service mysql-default stop).

The same behaviour can be observed by bumping the package_version between to chef-client runs

klyonrad commented 8 years ago

When updating, the debian postinst script attempts to shutdown the mysql service http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/mysql-5.5/trusty-updates/view/head:/debian/mysql-server-5.5.postinst#L63 set +e; invoke stop; set -e

calling stop on the mysql service does not work because this cookbook configures that service to be stopped / not running

service mysql stop

stop: Unknown instance: 

to quote @someara from https://github.com/chef-cookbooks/mysql/issues/344#issuecomment-111859880

Package upgrades often contain unpredictable post installation scripts, override changes to init scripts, and place extra files in configuration directories. It turns out what we want is full, manual control over every step of the configuration process.

So how do we get control over the upgrade process?

cheeseplus commented 7 years ago

Labeling this as a bug for now but this will probably end up a dupe as it's related to some other core architectural issues of how the cookbook is structured.

cheeseplus commented 7 years ago

Dupe of https://github.com/chef-cookbooks/mysql/issues/466

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.