From user-return-12216-archive-asf-public=cust-asf.ponee.io@zookeeper.apache.org Wed Oct 9 06:31:32 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6D70E180645 for ; Wed, 9 Oct 2019 08:31:32 +0200 (CEST) Received: (qmail 46959 invoked by uid 500); 9 Oct 2019 06:31:30 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 46943 invoked by uid 99); 9 Oct 2019 06:31:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2019 06:31:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 90E7EC2150 for ; Wed, 9 Oct 2019 06:31:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.901 X-Spam-Level: * X-Spam-Status: No, score=1.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=0.1] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id y9o8Ctbi8dtt for ; Wed, 9 Oct 2019 06:31:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.178; helo=mail-vk1-f178.google.com; envelope-from=c.turksema@gmail.com; receiver= Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 6256BBC9D0 for ; Wed, 9 Oct 2019 06:25:34 +0000 (UTC) Received: by mail-vk1-f178.google.com with SMTP id 70so288071vkz.8 for ; Tue, 08 Oct 2019 23:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=V2L2ApQO8e8YOu3JaqZAgido8pHNVftEsECfSxn3b8k=; b=H1FxazTFPPGTg1o/UHrcyA971uPI2uhjGgHKwliGt7w6q6OqzLDr2wiVh+9nsyQYBh jfJfLlvRSp2Fqo5xHLJHVU3vC1X4aEncPQJHj2PP4u3Xli2bqP4w9pJedilpgdu8x8r6 nR69JA7zwtSHYB2kAvaJ+cSdK5x/RQ0qVkl1Db78qVWDr+5A2y4H3UVTBdj270tzw1Jz IRjcdSsi/UyROCYyb/kDeMAOTUdDD07G3bjhfbgepNe76FSm/A8dztRvlzLrj1nZgBC/ jV+l7h5L1MDMiPF15PDbi0fNny62op9TRRZ+RxaFcXUniX+sYPLLINT1SIj0whcY9ap+ h8Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=V2L2ApQO8e8YOu3JaqZAgido8pHNVftEsECfSxn3b8k=; b=U4N6jq8oW2oREteAvMWNAJJQzFtYPhZHr0bZ/spwR7zkZgYtvLS53Cb9mSavMQXgcG wEKduxWh0i4AkvrR+RJPMGDRIhiLPziWywajup2HdbascI/cJr0tep3Afr/GAzuD4o+d fvXun+vuvcZqB0SFnxBP0CaFlaq9aD0g0ZNM5EO2e6FFdGih4fmP05MCtZdCKdgVdePd hTD6QVcIAxk9/qu+AYP/0MEPOjnYfTUWa3iCoXTw4KLwjXDYIy/cu52FovOmrGamjVYR HY7G7XLu0zuPJY/nY0DYxoDhpllBTYdbtzMduFYIIbYNb/UiZtzOFXEq3wGS+cRecwvY ZGOA== X-Gm-Message-State: APjAAAU//GpYKValO002ZjziDKjVnXfU2a57cPMg423nc9691ScB0FJg r/LHThxjqtSXIw7EUWmDx9Q/AWSsNVg+8RcCcdqcBVlL X-Google-Smtp-Source: APXvYqy73WzabDWAUZZdCzCVUAlMVPzFaBSo4UxXmOWduDgCBCsT7xjf95c0EKmWirM50ePPTgrFPlNc6UecPGFH1/Y= X-Received: by 2002:a1f:9e04:: with SMTP id h4mr1165364vke.83.1570602333446; Tue, 08 Oct 2019 23:25:33 -0700 (PDT) MIME-Version: 1.0 References: <16cb4ac9140.27db.495a588ebf64bb63541fbe4ec3b29808@gmail.com> <1569553573259-0.post@n2.nabble.com> <1569724216595-0.post@n2.nabble.com> <16d7b5d5428.27db.495a588ebf64bb63541fbe4ec3b29808@gmail.com> <1570522120536-0.post@n2.nabble.com> <1570595027392-0.post@n2.nabble.com> In-Reply-To: <1570595027392-0.post@n2.nabble.com> From: "Chris T." Date: Wed, 9 Oct 2019 08:25:22 +0200 Message-ID: Subject: Re: About ZooKeeper Dynamic Reconfiguration To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary="0000000000002b29dd0594745aa6" --0000000000002b29dd0594745aa6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I sent it again, please check. On Wed, Oct 9, 2019 at 6:31 AM Gao,Wei wrote: > Hi oo4load, > Where did you sent it to? Through this site or directly sent to my emai= l? > I received your pseudo codes last week just like this shown below: > > buildDatacenterAndServerModel(configurationFile) { > enum zookeeperRole PARTICIPANT, OBSERVER, NONE, DOWN > object datacenter has servers > object server has zookeeperRole configuredRole, zookeeperRole activeRol= e > parse(configurationFile) into (datacenter, servers); > } > shiftMajority(designatedSurvivorDatacenter) { > > > designatedSurvivorDatacenter.someObserver.dynamicReconfigure(server=3DPAR= TICIPANT) > otherDatacenter.someParticipant.dynamicReconfigure(server=3DOBSERVER) > } > balanceServerRoles() { > if (designatedSurvivorDatacenter.hasMinimumQuorum) > someParticipant.dynamicReconfigure(server=3DOBSERVER) > if (quorumSize.aboveSafeLimit) > someObserver.dynamicReconfigure(server=3DPARTICIPANT) > //This is a lot more complicated than 2 simple commands, you need a= n > algorithm or define several scenarios. > } > > > main() { > buildDatacenterAndServerModel(configurationFile); > while (IamLeader) { > parse(zk.getData(=E2=80=9C/zookeeper/config=E2=80=9D)) into servers.c= onfiguredRole; > foreach(server) getServerRole(=E2=80=9Cserver:8081/commands/stat=E2= =80=9D) into > servers.activeRole; > > foreach(server.activeRole=3DDOWN) dynamicReconfigure(server=3DOBSERV= ER); > server.setConfiguredRole(OBSERVER); > > if(designatedSurvivorDatacenter !=3D datacenter.hasMajority) > shiftMajority(designatedSurvivorDatacenter); > balanceServerRoles(); > } > } > > If this above is not what you mean, would you please send it again? > Really appreciate for your kindness! > > > > > > -- > Sent from: http://zookeeper-user.578899.n2.nabble.com/ > --0000000000002b29dd0594745aa6--