ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-612

Make Zookeeper C client can be compiled by gcc of early version

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Component/s: c client
    • Labels:
      None
    • Environment:

      Linux

    • Hadoop Flags:
      Reviewed
    • Release Note:
      to be able to compile c library with gcc 2.96 and greater.
    • Tags:
      gcc, c client

      Description

      The original C Client, Version 3.2.1, cannot be compiled successfully by the gcc of early version, due some declaration restriction. To compile the source code on the server with gcc of early version, I made some modification on the original source. What's more, some extra codes are added to make the client be compatible with the hosts list format: ip1:port1, ip2:port2... There is often a space after this kind of comma.

      1. ZOOKEEPER-612.patch
        13 kB
        Qian Ye
      2. ZOOKEEPER-612.patch
        12 kB
        Qian Ye
      3. ZOOKEEPER-612.patch
        13 kB
        Patrick Hunt
      4. ZOOKEEPER-612.patch
        13 kB
        Qian Ye
      5. patch
        12 kB
        Qian Ye
      6. patch
        12 kB
        Qian Ye

        Activity

        Qian Ye created issue -
        Hide
        Qian Ye added a comment -

        can be compiled by gcc 2.96

        Show
        Qian Ye added a comment - can be compiled by gcc 2.96
        Qian Ye made changes -
        Field Original Value New Value
        Attachment patch [ 12427148 ]
        Qian Ye made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Release Note fix a semicolon mistake
        Qian Ye made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Qian Ye added a comment -

        fix a semicolon mistake

        Show
        Qian Ye added a comment - fix a semicolon mistake
        Qian Ye made changes -
        Attachment patch [ 12428947 ]
        Hide
        Benjamin Reed added a comment -

        this looks good except for one piece of code:

        • hints.ai_flags = AI_ADDRCONFIG;
          + //hints.ai_flags = AI_ADDRCONFIG;
          + hints.ai_flags = 0;

        why do you remove AI_ADDRCONFIG?

        Show
        Benjamin Reed added a comment - this looks good except for one piece of code: hints.ai_flags = AI_ADDRCONFIG; + //hints.ai_flags = AI_ADDRCONFIG; + hints.ai_flags = 0; why do you remove AI_ADDRCONFIG?
        Patrick Hunt made changes -
        Assignee Qian Ye [ creatstar ]
        Fix Version/s 3.3.0 [ 12313976 ]
        Hide
        Patrick Hunt added a comment -

        Qian thanks for the patch, in future please name the patch after the issue such as ZOOKEEPER-612.patch in this case. Thanks. FYI: http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute

        Show
        Patrick Hunt added a comment - Qian thanks for the patch, in future please name the patch after the issue such as ZOOKEEPER-612 .patch in this case. Thanks. FYI: http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute
        Hide
        Qian Ye added a comment -

        To Benjamin Reed:
        Because AI_ADDRCONFIG is available since glibc 2.3.3, and I had to compile this patch on a server with glibc 2.2.5, a very old version

        To Patrick Hunt:
        Thanks for your tips, really helpful

        Show
        Qian Ye added a comment - To Benjamin Reed: Because AI_ADDRCONFIG is available since glibc 2.3.3, and I had to compile this patch on a server with glibc 2.2.5, a very old version To Patrick Hunt: Thanks for your tips, really helpful
        Hide
        Patrick Hunt added a comment -

        @qian in that case I suggest you ifdef it, something like:

        ifdef ai_addrconfig
        foo = ai_addrconfig
        else
        foo = 0

        that sound reasonable?

        Show
        Patrick Hunt added a comment - @qian in that case I suggest you ifdef it, something like: ifdef ai_addrconfig foo = ai_addrconfig else foo = 0 that sound reasonable?
        Hide
        Qian Ye added a comment -

        yes Patrick, reasonable tips, a patch for this is attached, thx

        Show
        Qian Ye added a comment - yes Patrick, reasonable tips, a patch for this is attached, thx
        Qian Ye made changes -
        Attachment ZOOKEEPER-612.patch [ 12429617 ]
        Patrick Hunt made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12429617/ZOOKEEPER-612.patch
        against trunk revision 899383.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no tests are needed for this patch.

        -1 patch. The patch command could not apply the patch.

        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/37/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12429617/ZOOKEEPER-612.patch against trunk revision 899383. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. -1 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/37/console This message is automatically generated.
        Hide
        Qian Ye added a comment -

        Is that because I didn't make the patch based on the latest svn chunk version? Should I make a new patch based on it?

        Show
        Qian Ye added a comment - Is that because I didn't make the patch based on the latest svn chunk version? Should I make a new patch based on it?
        Hide
        Mahadev konar added a comment -

        steven,
        yes you are right. you will have to create a patch against trunk.

        Show
        Mahadev konar added a comment - steven, yes you are right. you will have to create a patch against trunk.
        Hide
        Mahadev konar added a comment -

        sorry, I meant Qian....

        Show
        Mahadev konar added a comment - sorry, I meant Qian....
        Hide
        Qian Ye added a comment -

        New patch against trunk

        Show
        Qian Ye added a comment - New patch against trunk
        Qian Ye made changes -
        Attachment ZOOKEEPER-612.patch [ 12430694 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Patrick Hunt added a comment -

        Qian, if you want a patch to be reviewed (ie you are done) the best thing is to click on "submit patch" link on the left hand side.
        this starts the CI patch review and lets us know that you're ready. If you submit an updated patch (such as this case)
        then just cancel the patch and re-submit. Regards. (I've done it this time for you)

        Show
        Patrick Hunt added a comment - Qian, if you want a patch to be reviewed (ie you are done) the best thing is to click on "submit patch" link on the left hand side. this starts the CI patch review and lets us know that you're ready. If you submit an updated patch (such as this case) then just cancel the patch and re-submit. Regards. (I've done it this time for you)
        Patrick Hunt made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12430694/ZOOKEEPER-612.patch
        against trunk revision 899383.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        -1 patch. The patch command could not apply the patch.

        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/39/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12430694/ZOOKEEPER-612.patch against trunk revision 899383. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. -1 patch. The patch command could not apply the patch. Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/39/console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        Qian, the patch is failing to apply to the trunk, can you take a look at the hadoopqabot output?

        Show
        Patrick Hunt added a comment - Qian, the patch is failing to apply to the trunk, can you take a look at the hadoopqabot output?
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Patrick Hunt added a comment -

        I fixed the patch to be relative to trunk (was relative to trunk/src).

        Show
        Patrick Hunt added a comment - I fixed the patch to be relative to trunk (was relative to trunk/src).
        Patrick Hunt made changes -
        Attachment ZOOKEEPER-612.patch [ 12431051 ]
        Patrick Hunt made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12431051/ZOOKEEPER-612.patch
        against trunk revision 901510.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12431051/ZOOKEEPER-612.patch against trunk revision 901510. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/47/console This message is automatically generated.
        Hide
        Patrick Hunt added a comment -

        this fails with the following:

        [exec] [exec] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/include -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/tests -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c -fPIC -DPIC -o .libs/zookeeper.o
        [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c: In function `zookeeper_process':
        [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c:1813: error: syntax error before "if"
        [exec] [exec] make: *** [zookeeper.lo] Error 1

        Show
        Patrick Hunt added a comment - this fails with the following: [exec] [exec] libtool: compile: gcc -DHAVE_CONFIG_H -I. -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/include -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/tests -I/grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/generated -Wall -Werror -g -O2 -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c -fPIC -DPIC -o .libs/zookeeper.o [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c: In function `zookeeper_process': [exec] [exec] /grid/0/hudson/hudson-slave/workspace/Zookeeper-Patch-h7.grid.sp2.yahoo.net/trunk/src/c/src/zookeeper.c:1813: error: syntax error before "if" [exec] [exec] make: *** [zookeeper.lo] Error 1
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Qian Ye added a comment -

        Thanks Patrick, I will take a look at it.

        Show
        Qian Ye added a comment - Thanks Patrick, I will take a look at it.
        Qian Ye made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Release Note fix a semicolon mistake
        Hide
        Qian Ye added a comment -

        update the patch

        Show
        Qian Ye added a comment - update the patch
        Qian Ye made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Qian Ye made changes -
        Attachment ZOOKEEPER-612.patch [ 12431209 ]
        Qian Ye made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Release Note update the path, hope it works this time
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12431209/ZOOKEEPER-612.patch
        against trunk revision 902320.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12431209/ZOOKEEPER-612.patch against trunk revision 902320. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h7.grid.sp2.yahoo.net/52/console This message is automatically generated.
        Hide
        Mahadev konar added a comment -

        +1 the patch looks good.

        Show
        Mahadev konar added a comment - +1 the patch looks good.
        Hide
        Mahadev konar added a comment -

        I just commited this. thanks qian.

        Show
        Mahadev konar added a comment - I just commited this. thanks qian.
        Mahadev konar made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Release Note update the path, hope it works this time to be able to compile c library with gcc 2.96 and greater.
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #680 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/680/)

        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #680 (See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/680/ )
        Patrick Hunt made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Patch Available Patch Available Open Open
        3d 20h 15m 5 Qian Ye 23/Jan/10 09:06
        Open Open Patch Available Patch Available
        43d 3h 57m 6 Qian Ye 23/Jan/10 09:11
        Patch Available Patch Available Resolved Resolved
        2d 15h 55m 1 Mahadev konar 26/Jan/10 01:07
        Resolved Resolved Closed Closed
        59d 16h 17m 1 Patrick Hunt 26/Mar/10 17:25

          People

          • Assignee:
            Qian Ye
            Reporter:
            Qian Ye
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development