GitHub user ahgittin opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/197
[WIP] Rebind read only
The guts of the changes to support a read-only / hot-standby mode for
management.
The design minimizes code changes and lends itself to being adapted for
multiple masters looking after different entities.
For review only at this point; still I'd like to:
* Have a property determining whether default is `STANDBY` or `HOT_STANDBY`
* Failure on `HOT_STANDBY` moves to `FAILURE` mode
* Support `BrooklynObject` replacement on subsequent rebind (and
unmanagement when items removed)
* Ensure `BrooklynObject` unmanagement and cleanup on demotion (this
probably doesn't happen)
* Programmatic means of forcing transition from `FAILURE` to `STANDBY` or
`HOT_STANDBY` (or `TERMINATED`) and from `MASTER` to `STANDBY`, `HOT_STANDBY`,
or `TERMINATED`.
* Prevent activity for policies, feeds, enrichers, etc (possibly by
promoting `suspend`/`resume` to `EntityAdjunct` and `AbstractEntityAdjunct` and
in the latter checking the RO status of the entity; this won't catch everything
but should catch most and make it easier to refactor those things which attempt
a scheduled task inside `setEntity` ... that's not quite the answer, but in
that direction I feel)
Subsequent to this we'll need some GUI/REST support to, at minimum, allow
operators to access (after a warning probably) standby and failed servers, to
display rebind problems, and to force a state change.
That will allow us to design a sensible `BrooklynCluster` with failover.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ahgittin/incubator-brooklyn rebind-read-only
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/197.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 #197
----
commit 56dff37f9cad9ea06740755b514f4c659a6d61e2
Author: Alex Heneveld <[email protected]>
Date: 2014-09-26T12:41:46Z
add a hot_standby mode, now the default when running HA (although it
doesn't do anything, it is a coherent state and the MasterChooser prefers it)
commit 4029325d898a36c9772ee3557956038ded04002c
Author: Alex Heneveld <[email protected]>
Date: 2014-09-26T21:29:00Z
RebindManager is can run in persistence mode or in read-only mode
commit 20997d0f4f9da109658231d8f2d4ef87f3a05ac8
Author: Alex Heneveld <[email protected]>
Date: 2014-09-26T22:27:54Z
set up a new ManagementContext.getServerExecutionContext() and use that for
node-level tasks, with a tag that can be tracked; improve lifecycle and
configuration for rebind exception handler and for the persister itself
commit 3bc19bedcee8058ec3aa9165b99ebd27c865d1ca
Author: Alex Heneveld <[email protected]>
Date: 2014-09-29T12:36:18Z
improve support for interrupting scheduled tasks and a "wait for
interrupted tasks to really complete" method on Tasks; see discussion there,
and test case in ScheduledExecutionTest.java
commit 2f59fdb50157e15f589fd7a9d8abda8060e5d39c
Author: Alex Heneveld <[email protected]>
Date: 2014-09-29T15:07:08Z
hot standby / read-only rebind is working. more to do, but this is the
guts of it.
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---