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

Coding error in recipes/lock/src/c/src/zoo_lock.c

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.4.6
    • None
    • recipes
    • None
    • arch linux 64bit

    Description

      In fuction child_floor(), strcmp() is used to compare the whole string.
      But there exists conditions a sorted_data looks like ("x-000-00", "x-222-01", "x-111-02"), and now "x-222-01" is calling child_floor() to get a predecessor for watching, so the current logic will return "x-111-02" instead of the correct "x-000-00".
      Use a strcmp() == 0 and a break statement should solve this problem.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tsingakbar YuQing

            Dates

              Created:
              Updated:

              Slack

                Issue deployment