ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1206

Sequential node creation does not use always use digits in node name given certain Locales.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.3.4, 3.4.0, 3.5.0
    • Component/s: server
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      While I always expect to be able to parse a sequential node by looking for digits, under some locals you end up with non digits - for example: n_००००००००००

      It looks like the problem is around line 236 in PrepRequestProcessor:

                      if (createMode.isSequential()) {
                          path = path + String.format("%010d", parentCVersion);
                      }
      

      Instead we should pass Locale.ENGLISH to the format call.

                      if (createMode.isSequential()) {
                          path = path + String.format(Locale.ENGLISH, "%010d", parentCVersion);
                      }
      

      Lucene/Solr tests with random Locales, and some of my tests that try and inspect the node name and order things expect to find digits - currently my leader election recipe randomly fails when the wrong locale pops up.

      1. ZOOKEEPER-1206-3.3.patch
        0.9 kB
        Mark Miller
      2. ZOOKEEPER-1206.patch
        0.9 kB
        Mark Miller
      3. ZOOKEEPER-1206-3.4.patch
        0.9 kB
        Mark Miller

        Activity

        Hide
        Patrick Hunt added a comment -

        Seems like a straightforward fix - Mark could you submit a patch for this?

        Show
        Patrick Hunt added a comment - Seems like a straightforward fix - Mark could you submit a patch for this?
        Hide
        Mark Miller added a comment -

        The trunk patch is identical to the patch needed by the 3.3 branch. The 3.4 version of the patch is needed for the 3.4 branch.

        Show
        Mark Miller added a comment - The trunk patch is identical to the patch needed by the 3.3 branch. The 3.4 version of the patch is needed for the 3.4 branch.
        Hide
        Hadoop QA added a comment -

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

        +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 new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

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

        Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/596//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/12496964/ZOOKEEPER-1206.patch against trunk revision 1177191. +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 new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-ZOOKEEPER-Build/596//console This message is automatically generated.
        Hide
        Mahadev konar added a comment -

        Mark can you please update the patch? looks like it doesnt apply.

        Show
        Mahadev konar added a comment - Mark can you please update the patch? looks like it doesnt apply.
        Hide
        Mark Miller added a comment -

        Sorry - I'm at a loss for the moment - that patch was made off latest trunk and applies to latest trunk for me. I'm obviously missing something...

        Show
        Mark Miller added a comment - Sorry - I'm at a loss for the moment - that patch was made off latest trunk and applies to latest trunk for me. I'm obviously missing something...
        Hide
        Camille Fournier added a comment -

        Try resynching your code base and creating the patch again. It doesn't apply cleanly for me due to the import statements, which were cleaned up in a checkin on 9/14.

        Show
        Camille Fournier added a comment - Try resynching your code base and creating the patch again. It doesn't apply cleanly for me due to the import statements, which were cleaned up in a checkin on 9/14.
        Hide
        Mark Miller added a comment -

        Silly me - my orig checkout is off the 3.3 branch not trunk - my bad - new patch coming.

        Show
        Mark Miller added a comment - Silly me - my orig checkout is off the 3.3 branch not trunk - my bad - new patch coming.
        Hide
        Mark Miller added a comment -

        patch to trunk

        Show
        Mark Miller added a comment - patch to trunk
        Hide
        Mark Miller added a comment -

        here is the 3.3 patch

        Show
        Mark Miller added a comment - here is the 3.3 patch
        Hide
        Patrick Hunt added a comment -

        committed to 3.3/3.4/trunk. Thanks Mark!

        Show
        Patrick Hunt added a comment - committed to 3.3/3.4/trunk. Thanks Mark!
        Hide
        Hudson added a comment -

        Integrated in ZooKeeper-trunk #1319 (See https://builds.apache.org/job/ZooKeeper-trunk/1319/)
        ZOOKEEPER-1206. Sequential node creation does not use always use digits in node name given certain Locales. (Mark Miller via phunt)

        phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1177432
        Files :

        • /zookeeper/trunk/CHANGES.txt
        • /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
        Show
        Hudson added a comment - Integrated in ZooKeeper-trunk #1319 (See https://builds.apache.org/job/ZooKeeper-trunk/1319/ ) ZOOKEEPER-1206 . Sequential node creation does not use always use digits in node name given certain Locales. (Mark Miller via phunt) phunt : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1177432 Files : /zookeeper/trunk/CHANGES.txt /zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java

          People

          • Assignee:
            Mark Miller
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development