[ https://issues.apache.org/jira/browse/ZOOKEEPER-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793531#comment-13793531 ]
Alexander Shraer commented on ZOOKEEPER-1783: --------------------------------------------- Exactly. When specifying config files the user doesn't specify the version and we treat this as version = 0. The version is then set to the zxid of the reconfig operations. So suppose that you have an ensemble that never reconfigured before. Its version is 0. And now you start a new server that wants to join, it also has version = 0. We need that new server to adopt the current config from the leader. But since both have version = 0 this doesn't happen. The main fix is just a few lines to Leader.java + a new test (to check that now the version of an established ensemble is > 0) and similar change to C tests that were checking for version = 0. Everything else in the patch was needed because now some of the new reconfig-related code (writing dynamic files, potentially restarting leader election) is activated even if we don't invoke reconfig. Also in context that was never tested before like with read-only mode being enabled. > Distinguish initial configuration from first established configuration > ---------------------------------------------------------------------- > > Key: ZOOKEEPER-1783 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1783 > Project: ZooKeeper > Issue Type: Bug > Components: quorum, server > Affects Versions: 3.5.0 > Reporter: Alexander Shraer > Assignee: Alexander Shraer > Fix For: 3.5.0 > > Attachments: ZOOKEEPER-1783.patch, ZOOKEEPER-1783-ver1.patch, > ZOOKEEPER-1783-ver2.patch, ZOOKEEPER-1783-ver3.patch, > ZOOKEEPER-1783-ver4.patch, ZOOKEEPER-1783-ver5.patch > > > We need a way to distinguish an initial config of a server and an initial > config of a running ensemble (before any reconfigs happen). Currently both > have version 0. > The version of a config increases with each reconfiguration, so the problem > is just with the initial config. -- This message was sent by Atlassian JIRA (v6.1#6144)