Pivotal Knowledge Base

Follow

How to upgrade MADlib?

Environment

Product Version
Pivotal Greenplum (GPDB)  4.3.x
OS  RHEL 6.x

Purpose

In this article, we will focus on how to upgrade an existing MADlib installation.

Things to Consider before Upgrade

  • Once upgraded there is no rollback, so test MADlib version before upgrading in the Production environment. 
  • If gppkg -u is used old version of MADlib RPMs will be removed and the new version will be install.
  • It is good idea to do this upgrade during the maintenance window or make sure to have application not use MADlib function while this process is being performed.
  • If any table that depends on MADlib type and if you decide to rollback new version by uninstalling MADlib then it will also remove dependent table and it's data. As uninstall executes "drop schema <madlib> cascade" command.
  • Please make sure that 1.8 version has all the function that are currently being used by your application.

Resolution

Upgrade Madlib from 1.7 to 1.8 

Step 1: Find out what version of MADlib is installed 

[gpadmin@master GPDB_4.3]$ gppkg --query --all

20160114:05:48:50:012765 gppkg:master:gpadmin-[INFO]:-Starting gppkg with args: --query --all

madlib-ossv1.7.1_pv1.9.3_gpdb4.3orca

Above output confirms that MADlib 1.7.1 was installed.

Step 2: Download appropriate MADlib version (1.8) GPDB 4.3 package from https://network.pivotal.io:

[gpadmin@master ~]$ tar -xvf madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.tar

GPDB_4.3/

GPDB_4.3/open_source_license_MADlib_1.8_GA.txt

GPDB_4.3/ReleaseNotes.txt

GPDB_4.3/madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.gppkg

Step 3: Upgrade MADlib rpms using gppkg -u 

[gpadmin@master GPDB_4.3]$ gppkg -u madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.gppkg

20160114:06:14:06:183670 gppkg:master:gpadmin-[INFO]:-Starting gppkg with args: -u madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.gppkg

20160114:06:14:06:183670 gppkg:master:gpadmin-[WARNING]:-WARNING: The process of updating a package includes removing all

20160114:06:14:06:183670 gppkg:master:gpadmin-[WARNING]:-previous versions of the system objects related to the package. For

20160114:06:14:06:183670 gppkg:master:gpadmin-[WARNING]:-example, previous versions of shared libraries are removed.

20160114:06:14:06:183670 gppkg:master:gpadmin-[WARNING]:-After the update process, a database function will fail when it is

20160114:06:14:06:183670 gppkg:master:gpadmin-[WARNING]:-called if the function references a package file that has been removed.

Do you still want to continue ? Yy|Nn (default=N):

> y

20160114:06:14:26:183670 gppkg:master:gpadmin-[INFO]:-Updating package madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.gppkg

..................

..................

20160114:06:14:29:183670 gppkg:master:gpadmin-[INFO]:-madlib-ossv1.8_pv1.9.4_gpdb4.3orca-rhel5-x86_64.gppkg successfully updated.

Step 4: Confirm that MADlib rpms 1.8 is installed.

[gpadmin@master GPDB_4.3]$ gppkg -q --all

20160114:06:15:02:183855 gppkg:master:gpadmin-[INFO]:-Starting gppkg with args: -q --all

madlib-ossv1.8_pv1.9.4_gpdb4.3orca

Step 5: If MADlib was installed with any database (e.g. mns database below), then schema also needs to be upgraded using madpack

[gpadmin@master GPDB_4.3]$ $GPHOME/madlib/bin/madpack upgrade -s madlib -p greenplum -c gpadmin@master:5432/mns

madpack.py : INFO : Detected Greenplum DB version 4.3ORCA.

madpack.py : INFO : *** Upgrading MADlib ***

madpack.py : INFO : MADlib tools version   = 1.8 (/usr/local/greenplum-db-4.3.6.2/madlib/Versions/1.8/bin/../madpack/madpack.py)

madpack.py : INFO : MADlib database version = 1.7.1 (host=master:5432, db=mns, schema=madlib)

..................

..................

madpack.py : INFO : > PL/Python environment OK (version: 2.6.2)

madpack.py : INFO : > - validation

madpack.py : INFO : MADlib 1.8 upgraded successfully in MADLIB schema.

Step 6: Check upgrade of schema using below command for mns database.

[gpadmin@master GPDB_4.3]$ $GPHOME/madlib/bin/madpack install-check -p greenplum -c gpadmin@master:5432/mns

madpack.py : INFO : Detected Greenplum DB version 4.3ORCA.

TEST CASE RESULT|Module: array_ops|array_ops.sql_in|PASS|Time: 337 milliseconds

TEST CASE RESULT|Module: bayes|gaussian_naive_bayes.sql_in|PASS|Time: 2140 milliseconds

..................

..................

TEST CASE RESULT|Module: pca|pca_project.sql_in|PASS|Time: 12043 milliseconds

TEST CASE RESULT|Module: pca|pca.sql_in|PASS|Time: 22598 milliseconds

TEST CASE RESULT|Module: validation|cross_validation.sql_in|PASS|Time: 49808 milliseconds

Additional Information 

Following Articles are referred:

Comments

Powered by Zendesk