[MCOL-4979] Upgrade Experience | CMAPI doesnt load old cmapi_server.conf after uninstall Created: 2022-02-02  Updated: 2022-10-26  Resolved: 2022-02-17

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: cmapi-1.6
Fix Version/s: cmapi-1.6.2

Type: Bug Priority: Blocker
Reporter: Allen Herrera Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-4965 Upgrade/UX Regression Closed

 Description   

After uninstalling and reinstall cmapi as said in documentation
https://mariadb.com/docs/operations/upgrades/upgrade-multi-node-from-5-to-6/#uninstall-the-old-version

Actual
cmapi_server.conf configuration is lost because cmapi_server.conf.rpmsave isnt loaded. Thus there is no x-api-key and curl calls fail.

Expected
When upgrading cmapi my cmapi_server.conf shouldnt be replaced with the default. My existing x-api-key should exist

post install you see the byte size difference
[root@ip-172-31-24-158 centos]# ll /etc/columnstore/
total 212
rw-rr-. 1 root root 282 Dec 13 03:11 cmapi_server.conf
rw-rr-. 1 mysql mysql 380 Feb 2 18:52 cmapi_server.conf.rpmsave



 Comments   
Comment by Alan Mologorsky [ 2022-02-08 ]

Finally made decision to keep edited config files all the time.
Thanks a lot to gdorman,David.Hall,toddstoffel!

In both (deb and rpm) packages now cmapi_server.conf file is the "noreplacing" config file.
But there are a bit different behaviour in deb and rpm.
RPM
After removing the package we got cmapi_server.conf.rpmsave file.
If we installing any version with this patch cmapi_server.conf.rpmsave will be used as a default config file.
New config (from installing package) will be renamed to cmapi_server.conf.rpmnew file.
This works even if we upgrading from current version to version with the patch without any promts.

DEB
While upgrading from any version started from version with the patch, every time will be used edited (customers) version of config file. Except if in both configs are added different lines at same places. Then we got interactive promt like this.

Configuration file '/etc/columnstore/cmapi_server.conf'                                                                                         ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version                                                                                             N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** cmapi_server.conf (Y/I/N/O/D/Z) [default=N] ? N

This is default behaviour of deb package managers.
To use the default action in automated scripts and to prevent opening promt, customer have to do one of following:

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>

or

export DEBIAN_FRONTEND=noninteractive; apt-get install -y -o Dpkg::Options::="--force-confold" <package>

Unfortunately there are no way to upgrade current version (using remove and install commands) to version with patch without config lost.

Comment by Daniel Lee (Inactive) [ 2022-02-17 ]

Build tested: ColumnStore 6.2.4 (b3885), CMAPI 1.6.2 (b607)

Tested same-version upgrade since the fix is in 6.2.4

Ubuntu18 DEB and repository installation and upgrade
Centos8 RPM and repository installation and upgrade

Also tested upgrade from 6.1.1 to 6.2.4

Ubuntu18 DEB and repository installation and upgrade
Centos8 RPM and repository installation and upgrade

**Please note that CMAPI 1.6.2 was used to install 6.1.1.

Generated at Thu Feb 08 02:54:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.