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

ASF GitHub Bot commented on ZOOKEEPER-2967:
-------------------------------------------

Github user eolivelli commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/450#discussion_r168301786
  
    --- Diff: 
src/java/test/org/apache/zookeeper/server/persistence/FileTxnSnapLogTest.java 
---
    @@ -35,92 +38,181 @@
     
     public class FileTxnSnapLogTest {
     
    -    /**
    -     * Test verifies the auto creation of data dir and data log dir.
    -     * Sets "zookeeper.datadir.autocreate" to true.
    -     */
    -    @Test
    -    public void testWithAutoCreateDataLogDir() throws IOException {
    -        File tmpDir = ClientBase.createEmptyTestDir();
    -        File dataDir = new File(tmpDir, "data");
    -        File snapDir = new File(tmpDir, "data_txnlog");
    -        Assert.assertFalse("data directory already exists", 
dataDir.exists());
    -        Assert.assertFalse("snapshot directory already exists", 
snapDir.exists());
    +    private File tmpDir;
    +
    +    private File logDir;
    +
    +    private File snapDir;
    +
    +    private File logVersionDir;
    +
    +    private File snapVersionDir;
    +
    +    @Before
    +    public void setUp() throws Exception {
    +        tmpDir = ClientBase.createEmptyTestDir();
    --- End diff --
    
    Maybe it could be a good improvement to start using junit TemporaryFolder 
rule so that the clean up will ve automatically handled by junit


> Add check to validate dataDir and dataLogDir parameters at startup
> ------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2967
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2967
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.4.11
>            Reporter: Andor Molnar
>            Assignee: Mark Fenes
>            Priority: Major
>              Labels: startup, validation
>             Fix For: 3.5.4, 3.6.0, 3.4.12
>
>
> According to  -ZOOKEEPER-2960- we should at a startup check to validate that 
> dataDir and dataLogDir parameters are set correctly.
> Perhaps we should introduce a check of some kind? If datalogdir is different 
> that datadir and snapshots exist in datalogdir we throw an exception and quit.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to