Kafka
  1. Kafka
  2. KAFKA-920

zkclient jar 0.2.0 is not compatible with 0.1.0

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: None
    • Labels:
      None

      Description

      Just realized that zkclient 0.2.0 introduced a non-backward compatible api. In 0.1.0, it has
      public void writeData(java.lang.String path, java.lang.Object datat)
      public void writeData(java.lang.String path, java.lang.Object datat, int expectedVersion)

      In 0.2.0, they are changed to

      public Stat writeData(java.lang.String path, java.lang.Object datat)
      public Stat writeData(java.lang.String path, java.lang.Object datat, int expectedVersion)

      This means that If an application uses Kafka and also drags in another library (X) that depends on zkclient 0.1.0 (and uses "void writeData())", then when they upgrade to Kafka 0.8 consumer (which uses zkclient 0.2.0), their application can't just upgrade to zkclient 0.2.0 since library X's call to "void writeData()" will fail because of the signature change. Since zkclient 0.1.0 is widely used, this issue may affect many applications.

      This non-backward compatible change was introduced by me since I didn't realize it's a signature change then. I am trying to see if zkclient can release a new version that's compatible. If that can't be done in time, we will have to downgrade zkclient to 0.1.0 and add the needed ZK functionality inside Kafka. This is not ideal, but can solve the issue quicker.

        Activity

        Hide
        Jun Rao added a comment -

        Attach a patch that downgrades zkclient to 0.1.0. The idea is to create a kafka.zookeeper.ZkClient that wraps zkclient and exposes the needed new api. All other changes are package renaming. Unit tests pass.

        Show
        Jun Rao added a comment - Attach a patch that downgrades zkclient to 0.1.0. The idea is to create a kafka.zookeeper.ZkClient that wraps zkclient and exposes the needed new api. All other changes are package renaming. Unit tests pass.
        Hide
        Neha Narkhede added a comment -

        I tried applying your patch, it fails at the new file -

        can't find file to patch at input line 392
        Perhaps you used the wrong -p or --strip option?
        The text leading up to this was:
        --------------------------

        diff --git a/core/src/main/scala/kafka/zookeeper/ZkClient.java b/core/src/main/scala/kafka/zookeeper/ZkClient.java
        index 9a82120..0c6e305 100644
        — a/core/src/main/scala/kafka/zookeeper/ZkClient.java
        +++ b/core/src/main/scala/kafka/zookeeper/ZkClient.java
        --------------------------
        Show
        Neha Narkhede added a comment - I tried applying your patch, it fails at the new file - can't find file to patch at input line 392 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- diff --git a/core/src/main/scala/kafka/zookeeper/ZkClient.java b/core/src/main/scala/kafka/zookeeper/ZkClient.java index 9a82120..0c6e305 100644 — a/core/src/main/scala/kafka/zookeeper/ZkClient.java +++ b/core/src/main/scala/kafka/zookeeper/ZkClient.java --------------------------
        Hide
        Jun Rao added a comment -

        Attach patch v2 (by using git diff HEAD).

        The zkclient folks actually just committed a change to make the api backward compatible with zkclient 0.1. So, we may be able to use zkclient 0.3 if it's released in time.

        Show
        Jun Rao added a comment - Attach patch v2 (by using git diff HEAD). The zkclient folks actually just committed a change to make the api backward compatible with zkclient 0.1. So, we may be able to use zkclient 0.3 if it's released in time.
        Hide
        Jun Rao added a comment -

        Thanks to the zkclient guys, they just released an 0.3 jar that's backward compatible with the 0.1 jar. Attached is a patch that upgrades zkclient to 0.3. Need to run sbt update to pick up the new jar.

        Show
        Jun Rao added a comment - Thanks to the zkclient guys, they just released an 0.3 jar that's backward compatible with the 0.1 jar. Attached is a patch that upgrades zkclient to 0.3. Need to run sbt update to pick up the new jar.
        Hide
        Neha Narkhede added a comment -

        +1, thanks for the patch!

        Show
        Neha Narkhede added a comment - +1, thanks for the patch!
        Hide
        Jun Rao added a comment -

        Thanks for the review. Committed to 0.8.

        Show
        Jun Rao added a comment - Thanks for the review. Committed to 0.8.

          People

          • Assignee:
            Jun Rao
            Reporter:
            Jun Rao
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development