From notifications-return-7310-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Thu Oct 10 11:23:19 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 83E27180626 for ; Thu, 10 Oct 2019 13:23:19 +0200 (CEST) Received: (qmail 88161 invoked by uid 500); 10 Oct 2019 11:23:19 -0000 Mailing-List: contact notifications-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list notifications@ignite.apache.org Received: (qmail 88152 invoked by uid 99); 10 Oct 2019 11:23:18 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Oct 2019 11:23:18 +0000 From: GitBox To: notifications@ignite.apache.org Subject: [GitHub] [ignite] Jokser commented on a change in pull request #6942: IGNITE-9913 Message-ID: <157070659883.25745.13563327097735889712.gitbox@gitbox.apache.org> Date: Thu, 10 Oct 2019 11:23:18 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Jokser commented on a change in pull request #6942: IGNITE-9913 URL: https://github.com/apache/ignite/pull/6942#discussion_r333464795 ########## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java ########## @@ -1982,7 +1982,37 @@ public boolean onCentralizedAffinityChange(final GridDhtPartitionsExchangeFuture }); synchronized (mux) { - this.waitInfo = null; + waitInfo = null; + } + + return true; + } + + /** + * Called on exchange initiated by baseline server node leave. + * + * @param fut Exchange future. + * @param crd Coordinator flag. + * @return {@code True} if affinity should be assigned by coordinator. + */ + public boolean onBaselineNodeLeft(final GridDhtPartitionsExchangeFuture fut, boolean crd) { + assert (fut.events().hasServerLeft() && !fut.firstEvent().eventNode().isClient()) : fut.firstEvent(); + + forAllRegisteredCacheGroups(new IgniteInClosureX() { + @Override public void applyx(CacheGroupDescriptor desc) throws IgniteCheckedException { + CacheGroupHolder cache = getOrCreateGroupHolder(fut.initialVersion(), desc); + + cache.aff.reinitializeWithoutOfflineNodes(fut.initialVersion()); Review comment: There is no guarantee that the next backup will have a partition in OWNING status. Case 1: Suppose that you have a partition with 2 backups. Primary is OWNER other nodes are MOVING: OMM The second backup completed rebalancing and now have OWNING partition state: OMO Now the primary node is left and you have: MO in affinity distribution. MOVING partition becomes primary which is incorrect behavior. Case 2: You lost your last OWNING partition in affinity. In this case, detectLostPartitions should be triggered. You also nullify WaitRebalanceInfo. You shouldn't do this because in this case if you have currently running rebalancing late affinity assignment will not be triggered after rebalancing completion. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services