Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.2.1, 3.3.0
    • Component/s: scripts
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      the zkCleanup.sh script is buggy in two ways:

      1) it doesn't actually pass through the snapshot count, so it doesn't work
      2) it assumes that there is only dataDir, it doesn't support dataLogDir

      And it can use cleanup, so that it doesn't blindly call eval from the config file..

      1. ZOOKEEPER-477.patch
        0.9 kB
        Mahadev konar
      2. ppp
        0.8 kB
        Fernando Padilla

        Activity

        Hide
        Fernando Padilla added a comment -

        Here is the diff/patch to apply. Yes I give all gives to Apache.

        — /export/home/fern/servers/zookeeper-3.2.0/bin/zkCleanup.sh 2009-07-01 09:51:22.000000000 -0700
        +++ puppet-mnt/etc/modules/zookeeper320/files/zkCleanup.sh 2009-07-17 12:01:08.000000000 -0700
        @@ -36,8 +36,16 @@

        . $ZOOBINDIR/zkEnv.sh

        -eval `grep -e "^dataDir=" $ZOOCFG`
        +ZOODATADIR=$(grep '^dataDir=' $ZOOCFG | sed -e 's/.*=//')
        +ZOODATALOGDIR=$(grep '^dataLogDir=' $ZOOCFG | sed -e 's/.*=//')

        +if [ "x$

        {ZOODATALOGDIR}

        " = "x" ]
        +then
        java "-Dzookeeper.log.dir=$

        {ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
        -cp $CLASSPATH $JVMFLAGS \
        - org.apache.zookeeper.server.PurgeTxnLog $dataDir
        + org.apache.zookeeper.server.PurgeTxnLog $ZOODATADIR $*
        +else
        +java "-Dzookeeper.log.dir=${ZOO_LOG_DIR}

        " "-Dzookeeper.root.logger=$

        {ZOO_LOG4J_PROP}

        " \
        + -cp $CLASSPATH $JVMFLAGS \
        + org.apache.zookeeper.server.PurgeTxnLog $ZOODATALOGDIR $ZOODATADIR $*
        +fi

        Show
        Fernando Padilla added a comment - Here is the diff/patch to apply. Yes I give all gives to Apache. — /export/home/fern/servers/zookeeper-3.2.0/bin/zkCleanup.sh 2009-07-01 09:51:22.000000000 -0700 +++ puppet-mnt/etc/modules/zookeeper320/files/zkCleanup.sh 2009-07-17 12:01:08.000000000 -0700 @@ -36,8 +36,16 @@ . $ZOOBINDIR/zkEnv.sh -eval `grep -e "^dataDir=" $ZOOCFG` +ZOODATADIR=$(grep '^dataDir=' $ZOOCFG | sed -e 's/.*=//') +ZOODATALOGDIR=$(grep '^dataLogDir=' $ZOOCFG | sed -e 's/.*=//') +if [ "x$ {ZOODATALOGDIR} " = "x" ] +then java "-Dzookeeper.log.dir=$ {ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ -cp $CLASSPATH $JVMFLAGS \ - org.apache.zookeeper.server.PurgeTxnLog $dataDir + org.apache.zookeeper.server.PurgeTxnLog $ZOODATADIR $* +else +java "-Dzookeeper.log.dir=${ZOO_LOG_DIR} " "-Dzookeeper.root.logger=$ {ZOO_LOG4J_PROP} " \ + -cp $CLASSPATH $JVMFLAGS \ + org.apache.zookeeper.server.PurgeTxnLog $ZOODATALOGDIR $ZOODATADIR $* +fi
        Hide
        Mahadev konar added a comment -

        fernando,
        can you please upload the patch in a file...

        just go to zookeeper-3.2.0/ directory and do an svn diff > patchfile.txt.

        Then upload the file via attach file link on the left hand side of this page.

        This way you will have to click on a button agreeing to donate your code to apache. This way we do not have any legal issues. Please do take a look at

        http://wiki.apache.org/hadoop/ZooKeeper/PoweredBy on how to contribute.

        thanks

        Show
        Mahadev konar added a comment - fernando, can you please upload the patch in a file... just go to zookeeper-3.2.0/ directory and do an svn diff > patchfile.txt. Then upload the file via attach file link on the left hand side of this page. This way you will have to click on a button agreeing to donate your code to apache. This way we do not have any legal issues. Please do take a look at http://wiki.apache.org/hadoop/ZooKeeper/PoweredBy on how to contribute. thanks
        Hide
        Fernando Padilla added a comment -

        patch to fix zkCleanup.sh

        Show
        Fernando Padilla added a comment - patch to fix zkCleanup.sh
        Hide
        Mahadev konar added a comment -

        patch against trunk.... the patch is the same but just generated against trunks top level directory.

        Show
        Mahadev konar added a comment - patch against trunk.... the patch is the same but just generated against trunks top level directory.
        Hide
        Mahadev konar added a comment -

        I just committed this. thanks fernando!

        Show
        Mahadev konar added a comment - I just committed this. thanks fernando!
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #412 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/412/)
        . zkCleanup.sh is flaky (fernando via mahadev)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #412 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/412/ ) . zkCleanup.sh is flaky (fernando via mahadev)

          People

          • Assignee:
            Fernando Padilla
            Reporter:
            Fernando Padilla
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development