You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by hanm <gi...@git.apache.org> on 2017/01/07 00:51:56 UTC

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

GitHub user hanm opened a pull request:

    https://github.com/apache/zookeeper/pull/144

    ZOOKEEPER-2325 for branch-3.4.

    There was a merge conflict on file Zab1_0Test.java when cherry-picking commit 7c51b01e89acb38165553366f7e3b2a46c00aa27 to branch-3.4. This PR resolves the merge conflict (it is trivial, just two imports conflicts).
    
    @breed @rgs1 @rakeshadr Please take a look and help committing this thanks.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/hanm/zookeeper ZOOKEEPER-2325

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zookeeper/pull/144.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #144
    
----
commit afd34f286c860591f1e26b1c29539b322cef7bcc
Author: Benjamin Reed <br...@fb.com>
Date:   2017-01-07T00:09:54Z

    ZOOKEEPER-2325 (Data inconsistency if all snapshots empty or missing) for branch-3.4.
    Resolved merge conflict on Zab1_0Test.java when cherry-picking 7c51b01e89acb38165553366f7e3b2a46c00aa27.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

Posted by afine <gi...@git.apache.org>.
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/144#discussion_r96525078
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java ---
    @@ -37,6 +37,8 @@
     import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.List;
    +import java.util.concurrent.ConcurrentHashMap;
    +import java.util.Map;
    --- End diff --
    
    nit: i don't think that this import is needed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

Posted by afine <gi...@git.apache.org>.
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/144#discussion_r96534854
  
    --- Diff: src/java/test/org/apache/zookeeper/test/EmptiedSnapshotRecoveryTest.java ---
    @@ -0,0 +1,133 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.zookeeper.test;
    +
    +import java.io.IOException;
    +import java.io.File;
    +import java.io.PrintWriter;
    +import java.util.List;
    +import java.util.LinkedList;
    --- End diff --
    
    a couple unneeded imports here as well


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

Posted by afine <gi...@git.apache.org>.
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/144#discussion_r96534436
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java ---
    @@ -37,6 +37,8 @@
     import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.List;
    +import java.util.concurrent.ConcurrentHashMap;
    +import java.util.Map;
    --- End diff --
    
    this change appears to break `testDirtySnapshot`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

Posted by afine <gi...@git.apache.org>.
Github user afine commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/144#discussion_r96526559
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnSnapLog.java ---
    @@ -135,8 +135,22 @@ public File getSnapDir() {
          */
         public long restore(DataTree dt, Map<Long, Integer> sessions, 
                 PlayBackListener listener) throws IOException {
    -        snapLog.deserialize(dt, sessions);
    +        long deserializeResult = snapLog.deserialize(dt, sessions);
             FileTxnLog txnLog = new FileTxnLog(dataDir);
    +        if (-1L == deserializeResult) {
    +            /* this means that we couldn't find any snapshot, so we need to
    +             * initialize an empty database (reported in ZOOKEEPER-2325) */
    +            if (txnLog.getLastLoggedZxid() != -1) {
    --- End diff --
    
    would it be worth adding the -1 case to the javadoc for deserialize?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zookeeper pull request #144: ZOOKEEPER-2325 for branch-3.4.

Posted by rakeshadr <gi...@git.apache.org>.
Github user rakeshadr commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/144#discussion_r96568373
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java ---
    @@ -37,6 +37,8 @@
     import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.List;
    +import java.util.concurrent.ConcurrentHashMap;
    +import java.util.Map;
    --- End diff --
    
    Good catch, @afine. This test is related to ZOOKEEPER-1558. Perhaps, we need to re-look the fix to see any chance of creating snapshot with uncommitted state.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---