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.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.3
    • 3.3.4, 3.4.0, 3.5.0
    • server
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: