ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1027

chroot not transparent in zoo_create()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.4.0
    • Component/s: c client
    • Labels:
      None
    • Environment:

      Linux, ZooKeeper 3.3.3, C-client, java 1.6.0_17-b04, hotspot server vm

    • Hadoop Flags:
      Reviewed
    • Release Note:
      Correctly removes the chroot from the returned path in a call to zoo_create()
    • Tags:
      chroot zookeeper zoo_create

      Description

      I've recently started to use the chroot functionality (introduced in
      3.2.0) as part of my connect string.It mostly works as expected, but
      there is one case that is unexpected: when I create a path with
      zoo_create() I can retrieve the created path. This is very useful when
      you set the ZOO_SEQUENCE flag. Unfortunately the returned path
      includes the chroot as part of the path. This was unexpected to me: I
      expected that the chroot would be totally transparent. The
      documentation for zoo_create() says:
      "path_buffer : Buffer which will be filled with the path of the new
      node (this might be different than the supplied path because of the
      ZOO_SEQUENCE flag)."

      This gave me the impression that this flag is the only reason the
      returned path is different from the created path, but apparently it's
      not. Is this a bug or intended behavior?
      I workaround this issue now by remembering the chroot in
      my wrapper code and after a call to zoo_create() i check if the returned
      path starts with the chroot. If it does, I remove it.

      My use case is to create a path with a sequence number and then delete
      this path later. Unfortunately I cannot delete the path because it has
      the chroot prepended to it, and thus it will result in two chroots.

      I believe this only affects the create functions.

      1. ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch
        2 kB
        Thijs Terlouw
      2. ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch
        2 kB
        Mahadev konar
      3. ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch
        2 kB
        Mahadev konar
      4. ZOOKEEPER-1027-PATCH-TRUNK2.patch
        3 kB
        Thijs Terlouw
      5. ZOOKEEPER-1027-PATCH-TRUNK3.patch
        3 kB
        Thijs Terlouw

        Issue Links

          Activity

          Mahadev konar made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Resolution Fixed [ 1 ]
          Thijs Terlouw made changes -
          Attachment ZOOKEEPER-1027-PATCH-TRUNK3.patch [ 12486412 ]
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Thijs Terlouw made changes -
          Attachment ZOOKEEPER-1027-PATCH-TRUNK2.patch [ 12486152 ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Patrick Hunt made changes -
          Priority Major [ 3 ] Critical [ 2 ]
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch [ 12485539 ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Mahadev konar made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Mahadev konar made changes -
          Attachment ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch [ 12483913 ]
          Mahadev konar made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Mahadev konar made changes -
          Fix Version/s 3.3.3 [ 12315482 ]
          Thijs Terlouw made changes -
          Attachment ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch [ 12477090 ]
          Thijs Terlouw made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Release Note Correctly removes the chroot from the returned path in a call to zoo_create()
          Thijs Terlouw made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Thijs Terlouw made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Thijs Terlouw made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Thijs Terlouw made changes -
          Attachment ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch [ 12477088 ]
          Thijs Terlouw made changes -
          Attachment zookeeper-3.3.3.patch [ 12474602 ]
          Thijs Terlouw made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Thijs Terlouw made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Thijs Terlouw made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Thijs Terlouw made changes -
          Attachment ZOOKEEPER-1027-TRUNK_WITH_TESTS.patch [ 12477088 ]
          Patrick Hunt made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Fix Version/s 3.4.0 [ 12314469 ]
          Mahadev konar made changes -
          Link This issue duplicates ZOOKEEPER-995 [ ZOOKEEPER-995 ]
          Thijs Terlouw made changes -
          Attachment zookeeper-3.3.3.patch [ 12474602 ]
          Thijs Terlouw made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Assignee Thijs Terlouw [ tt ]
          Fix Version/s 3.3.3 [ 12315482 ]
          Thijs Terlouw made changes -
          Field Original Value New Value
          Component/s c client [ 12312380 ]
          Component/s server [ 12312382 ]
          Thijs Terlouw created issue -

            People

            • Assignee:
              Thijs Terlouw
              Reporter:
              Thijs Terlouw
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development