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

dynamic configuration file renaming fails on Windows

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.0
    • Component/s: quorum
    • Labels:
      None
    • Environment:

      Windows 7 64-bit, Oracle Java 1.6.0_32-b05

      Description

      On Windows, reconfig fails to rename the tmp dynamic config file to the real dynamic config filename.
      Javadoc of java.io.File.renameTo says the behavior is highly plateform dependent, so I guess this should not be a big surprise.
      The problem occurs in src/java/main/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java that could be modified like this:
      + curFile.delete();
      if (!tmpFile.renameTo(curFile)) {
      + configFile.delete();
      if (!tmpFile.renameTo(configFile)) {
      As suggested by Alex in https://issues.apache.org/jira/browse/ZOOKEEPER-1691 (btw there is more information about my test scenario over there) it is a bit "scary" to delete the current configuration file.

        Attachments

        1. ZOOKEEPER-1835.patch
          19 kB
          Bruno Freudensprung
        2. ZOOKEEPER-1835.patch
          25 kB
          Bruno Freudensprung
        3. ZOOKEEPER-1835.patch
          26 kB
          Bruno Freudensprung
        4. ZOOKEEPER-1835.patch
          26 kB
          Bruno Freudensprung
        5. ZOOKEEPER-1835.patch
          29 kB
          Bruno Freudensprung
        6. ZOOKEEPER-1835.patch
          29 kB
          Bruno Freudensprung

          Activity

            People

            • Assignee:
              bfreuden Bruno Freudensprung
              Reporter:
              bfreuden Bruno Freudensprung
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: