Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1206

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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.

        Attachments

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

          Activity

            People

            • Assignee:
              markrmiller@gmail.com Mark Miller
              Reporter:
              markrmiller@gmail.com Mark Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: