[
https://issues.apache.org/jira/browse/ZOOKEEPER-1994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14082549#comment-14082549
]
Alexander Shraer commented on ZOOKEEPER-1994:
---------------------------------------------
For the static file - it is sufficient to back it up only once - only when
configBackwardCompatibilityMode is on.
As for the dynamic file, here are my reasons for preferring solution #2:
1. When backing up a dynamic config we have to write down the version in the
backup file anyway.
2. Numbering the backups using versions will make backups easy to correlate
across different replicas. Whereas it is not clear that bak2 on one machine is
for the same thing as bak2 on another (unless you look inside and check the
version).
3. If the version is written in a separate file, it will be difficult to
maintain consistency between the version file and the dynamic configuration
file. Consider updating one of them but not the other and having a failure in
between.
With approach #2 changing files when the configuration fails is really
straightforward.
We don't have to move the old config file - it will just stay in the
configuration directory where the user is likely to look for configuration
files.
> Backup config files.
> --------------------
>
> Key: ZOOKEEPER-1994
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1994
> Project: ZooKeeper
> Issue Type: Improvement
> Affects Versions: 3.5.0
> Reporter: Hongchao Deng
> Assignee: Hongchao Deng
> Fix For: 3.5.0
>
>
> We should create a backup file for a static or dynamic configuration file
> before changing the file.
> Since the static file is changed at most twice (once when removing the
> ensemble definitions, at which point a dynamic file doesn't exist yet, and
> once when removing clientPort information) its probably fine to back up the
> static file independently from the dynamic file.
> To track backup history:
> Option 1: we could have a .bakXX extention for backup where XX is a sequence
> number.
> Option 2: have the configuration version be part of the file name for dynamic
> configuration files (instead of in the file like now). Such as
> zoo_replicated1.cfg.dynamic.1000000 then on reconfiguration simply create a
> new dynamic file (with new version) and update the link in the static file to
> point to the new dynamic one.
--
This message was sent by Atlassian JIRA
(v6.2#6252)