Pivotal Knowledge Base


How to upgrade Madlib?


  • Pivotal Greenplum 4.3.x
  • Operating System- Red Hat Enterprise Linux 6.x


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 an old version of Madlib RPMs will be removed and the new version will be install.
  • It is a 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 the dependent table and its data. As uninstall executes "drop schema <madlib> cascade" command.
  • Please make sure that 1.8 version has all the functionality that is currently being used by your application.


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


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





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


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-

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


Powered by Zendesk