AnsweredAssumed Answered

Rolling Upgrade for 1.2.0 should depend on the rpm-build package

Question asked by copiousfreetime on Jan 30, 2012
Latest reply on Jan 31, 2012 by Ted Dunning
I am testing out the [Rolling Upgrade for v1.2.0][1] and is failing on a vanilla 1.1.3 install. This is essentially both the question, and how to resolve it.

The rollingupgrade.sh script executes and fails on every node. In the `singlenodeupgrade.log.summary` on every server I see:

    [jeremy@mapr04 logs]$ cat singlenodeupgrade.log.summary
    [Mon Jan 30 13:56:47 EST 2012] Failed to save package mapr-core. To disable rollback, pass '-n' option to rollingupgrade.sh to disable rollback
    [Mon Jan 30 13:56:47 EST 2012] Upgrade failed!!

Digging in further using the `singlenodeupgrad.lgo` results in seeing that the actual failure is:

    /opt/upgrade-mapr/timedcmd.sh 600 rpmrebuild -n --verify=no --batch --directory=/opt/rollback-mapr-1.1.3.11542GA-1 mapr-core
    Logging to /opt/mapr/logs/timedcmd.2012-01-30.13-56.29516.log

And the `/opt/mapr/logs/timedcmd.2012-01-30.13-56.29516.log` has the contents:

    [jeremy@mapr04 logs]$ cat /opt/mapr/logs/timedcmd.2012-01-30.13-56.29516.log
    ++ which timeout
    + '[' '' '!=' '' ']' 
    + rpmrebuild -n --verify=no --batch --directory=/opt/rollback-mapr-1.1.3.11542GA-1 mapr-core
    + PRODPID=29520
    + export PRODPID
    + trap exit_timeout SIGUSR1
    + export TIMEOUT
    + TPID=29521
    + wait 29520
    + sleep 600
    -bb: unknown option
    /usr/lib/rpmrebuild/rpmrebuild.sh: ERROR: package 'mapr-core' build failed
    + ret=1
    + kill 29521
    + exit 1

That `-bb: unknown option` is indicative of executing an old version of rpm expecting it to have all the build commands. Looking at the contents of `/usr/lib/rpmrebuild/rpmrebuild.sh` we can see:

    function RpmBuild
    {
        # reconstruction fichier rpm : le src.rpm est inutile
        # build rpm file, the src.rpm is not usefull to do
        # for rpm 4.1 : use rpmbuild
        local BUILDCMD=rpm
        [ -x /usr/bin/rpmbuild ] && BUILDCMD=rpmbuild
        eval $BUILDCMD $rpm_defines -bb $rpm_verbose $additional ${FIC_SPEC} || {
                Error "package '${PAQUET}' $BuildFailed"
                return 1
        }

        return 0
    }

Even the comment says what the issue is. CentOS, at least my 5.7 release, has rpmbuild available, and the `rpmrebuild` package does not depend on it, therefore all the rolling upgrades fail.

So there are two solutions:

 1. Update the rpmrebuild package that MapR is shipping to depend on the `rpm-build` package
 2. Update the [Rolling Upgrade][1] documentation to say that you should also do a `yum install rpm-build` on all machines in the cluster, or make sure that `rpm -bb` works.

Thanks.

  [1]: http://www.mapr.com/doc/display/MapR/Rolling+Upgrade1.2.

Outcomes