zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lvfangmin <...@git.apache.org>
Subject [GitHub] zookeeper pull request #605: [ZOOKEEPER-3125] Fixing pzxid consistent issue ...
Date Fri, 07 Sep 2018 05:32:28 GMT
Github user lvfangmin commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/605#discussion_r215849976
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/FuzzySnapshotRelatedTest.java
---
    @@ -0,0 +1,254 @@
    +/**
    + * 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.server.quorum;
    +
    +import java.io.IOException;
    +import java.util.HashMap;
    +import java.util.Map;
    +import javax.security.sasl.SaslException;
    +
    +import org.apache.jute.OutputArchive;
    +import org.apache.zookeeper.CreateMode;
    +import org.apache.zookeeper.PortAssignment;
    +import org.apache.zookeeper.ZooDefs.Ids;
    +import org.apache.zookeeper.ZooKeeper;
    +import org.apache.zookeeper.ZooKeeper.States;
    +import org.apache.zookeeper.data.Stat;
    +import org.apache.zookeeper.server.DataNode;
    +import org.apache.zookeeper.server.DataTree;
    +import org.apache.zookeeper.server.ZKDatabase;
    +import org.apache.zookeeper.server.ZooKeeperServer;
    +import org.apache.zookeeper.test.ClientBase;
    +
    +import org.junit.Assert;
    +import org.junit.After;
    +import org.junit.Before;
    +import org.junit.Test;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +/**
    + * Test cases used to catch corner cases due to fuzzy snapshot.
    + */
    +public class FuzzySnapshotRelatedTest extends QuorumPeerTestBase {
    +
    +    private static final Logger LOG = LoggerFactory.getLogger(FuzzySnapshotRelatedTest.class);
    +
    +    MainThread[] mt = null;
    +    ZooKeeper[] zk = null;
    +    int leaderId;
    +    int followerA;
    +
    +    @Before
    +    public void setup() throws Exception {
    --- End diff --
    
    The main difference is that I need to pass in Customized QuorumPeer to hook events in
ZK, there might be something in common, like how we generate the connection string, we may
do some refactor later, but I prefer to do that separately since we also need to touch other
tests who may have similar logics.


---

Mime
View raw message