Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8C399200C3C for ; Mon, 3 Apr 2017 09:45:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A6FD160B8F; Mon, 3 Apr 2017 07:45:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D22FB160B76 for ; Mon, 3 Apr 2017 09:45:50 +0200 (CEST) Received: (qmail 34466 invoked by uid 500); 3 Apr 2017 07:45:50 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 34452 invoked by uid 99); 3 Apr 2017 07:45:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2017 07:45:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 86D11DFE59; Mon, 3 Apr 2017 07:45:49 +0000 (UTC) From: neykov To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org Message-ID: Subject: [GitHub] brooklyn-server pull request #617: Persist management plane ID Content-Type: text/plain Date: Mon, 3 Apr 2017 07:45:49 +0000 (UTC) archived-at: Mon, 03 Apr 2017 07:45:51 -0000 GitHub user neykov opened a pull request: https://github.com/apache/brooklyn-server/pull/617 Persist management plane ID Some considerations on where to place the planeId initialisation: * BrooklynMemento (RebindManager). `planeId` will be available only after rebind, so it will be available to MASTER nodes only (and potentially HOT_STANDBY) * ManagementPlaneSyncRecord (HighAvailabilityManager). Used only when HA is enabled. When HA is disabled HighAvailabilityManager is not initialised, doesn't access the store at all, no records are getting written. * Separate init step in BrooklynLauncher. Early in the lifecycle so users need not to care too much when they are allowed to read it. On the other hand it's not encapsulated so need to touch all places that use persistence (i.e. launcher, copy-state, backup). Can only read from the store at this point, write access is not enabled yet. If HA is configured store writes are enabled only after becoming master. Writing to the store in this case would be risky, even if we know that it's a clean state (no planeId file). Better leave only the master update the store. Because of the above I decided to go for a mixed approach: * persist the `planeId` immediately after starting persistence (i.e. MASTER when HA) and repeat hourly * don't overwrite persisted store `planeId` if different * init `planeId` as part of the rebind sequence; if no `planeId` exists in store generate one * init `planeId` when reading the management records so we have it initialized for non-`MASTER` nodes as well; don't generate one if not in persisted store You can merge this pull request into a Git repository by running: $ git pull https://github.com/neykov/brooklyn-server plane-id Alternatively you can review and apply these changes as the patch at: https://github.com/apache/brooklyn-server/pull/617.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 #617 ---- commit 7bcc566bec9e4875207036b1943c4528aae72bea Author: Svetoslav Neykov Date: 2017-03-30T14:19:43Z Persist management plane ID commit 701c716aa27dbc3999c9c2fdd728e09089448b1a Author: Svetoslav Neykov Date: 2017-04-03T07:32:54Z Persisting management plane ID test coverage ---- --- 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. ---