You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Mattias Kregert (Jira)" <ji...@apache.org> on 2022/08/09 15:12:00 UTC

[jira] [Commented] (ZOOKEEPER-1967) Eliminate the temp dynamic config file, find last proposed config in transaction log.

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-1967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17577477#comment-17577477 ] 

Mattias  Kregert commented on ZOOKEEPER-1967:
---------------------------------------------

Trying to resurrect this 8 year old issue....

 

A very annoying thing is that ZK is creating the temp file in the wrong directory. I have the dynamic config file in /data/zoo.dynamic, but ZK tries to create a temp file in /conf which is write protected:

{{Error writing next dynamic config file to disk}}
{{java.io.FileNotFoundException: /conf/zoo.cfg.dynamic.next.tmp (Permission denied)}}

This makes absolutely no sense whatsoever. I guess somebody thought that they would create a temp file and then do an atomic replace, but that would not even work when these directories are on different devices. The correct (or less bad) way would be to create the temp file in the same directory as the original file. And it would even be ok in most cases to just create a backup and then write the file directly.

The way it works right now is far from optimal.

> Eliminate the temp dynamic config file, find last proposed config in transaction log.
> -------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1967
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1967
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: quorum, server
>            Reporter: Alexander Shraer
>            Priority: Major
>
> The .next temporary config file is created when a server acks a reconfig proposal.
> During reconfig commit this file becomes the permanent dynamic config file.
> This temp file is read (if exists) during server boot to determine whether there is a reconfig potentially in progress. 
> This info is also available in the transaction log, since reconfig is a transaction. Initially I chose not to take this information from the transaction log, mainly for simplicity, since I believed that we need the last proposed reconfig info before we're processing the transaction log (for example, if we'd like to contact new config servers during FLE - this is discussed in ZOOKEEPER-1807). 
> It would be useful to revisit this issue and check whether we could eliminate the temporary .next dynamic config file, finding the last proposed reconfig in the the transaction log.
> Note that a bulk of the work here will be modifying ReconfigRecoveryTest, which uses .next files to start a server in a state where it thinks it crashed in a middle of a reconfig.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)