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.4.patch
        0.9 kB
        Mark Miller
      2. ZOOKEEPER-1206-3.3.patch
        0.9 kB
        Mark Miller
      3. ZOOKEEPER-1206.patch
        0.9 kB
        Mark Miller

        Activity

        Mahadev konar made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Patrick Hunt made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Resolution Fixed [ 1 ]
        Patrick Hunt made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Mark Miller made changes -
        Attachment ZOOKEEPER-1206-3.3.patch [ 12497038 ]
        Patrick Hunt made changes -
        Assignee Mark Miller [ markrmiller@gmail.com ]
        Mark Miller made changes -
        Attachment ZOOKEEPER-1206.patch [ 12497014 ]
        Mark Miller made changes -
        Attachment ZOOKEEPER-1206.patch [ 12496964 ]
        Mahadev konar made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Mahadev konar made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Mark Miller made changes -
        Attachment ZOOKEEPER-1206-3.4.patch [ 12496963 ]
        Attachment ZOOKEEPER-1206.patch [ 12496964 ]
        Patrick Hunt made changes -
        Fix Version/s 3.4.0 [ 12314469 ]
        Fix Version/s 3.5.0 [ 12316644 ]
        Mark Miller made changes -
        Field Original Value New Value
        Summary Sequential node creation does not use always use digits in node name given certain Locales.Sequential node creation does not use always use digits in node name given certain Locales. Sequential node creation does not use always use digits in node name given certain Locales.
        Mark Miller created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development