[GitHub] brooklyn-server issue #916: DynamicCluster's max size applies to all calls t...

2018-01-03 Thread aledsage
Github user aledsage commented on the issue:

https://github.com/apache/brooklyn-server/pull/916
  
@nakomis @sjcorbett @tbouron are you suggesting we change the 
`AutoScalerPolicy` etc to do that, or that we leave it as-is so the auto-scaler 
doesn't work well with `maxSize` (unless the user duplicates the config in both 
the cluster and the policy)?

If it was just the UI/CLI, I'd be fine with leaving as-is. The human who 
called it would get feedback immediately that it failed, and would then know to 
try again. My issue is with programmatic usage - we need to do one of: 1) leave 
as-is so that users of auto-scaler etc need to duplicate the `maxSize` config; 
2) change `DynamicCluster` as I'm suggesting; or 3) change the programmatic 
usage of `resize` (but auto-scaler works with anything that is resizable, 
whereas `maxSize` is only defined on `DynamicCluster`.


---


[GitHub] brooklyn-docs pull request #242: Describe authentication options for catalog...

2018-01-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-docs/pull/242


---


[jira] [Resolved] (BROOKLYN-167) HighAvailabilityManagerImpl has invalid state if /v1/server/ha/states requested before BrooklynLauncher has fully initialised a server

2018-01-03 Thread Sam Corbett (JIRA)

 [ 
https://issues.apache.org/jira/browse/BROOKLYN-167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Corbett resolved BROOKLYN-167.
--
Resolution: Fixed

> HighAvailabilityManagerImpl has invalid state if /v1/server/ha/states 
> requested before BrooklynLauncher has fully initialised a server
> --
>
> Key: BROOKLYN-167
> URL: https://issues.apache.org/jira/browse/BROOKLYN-167
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Sam Corbett
>
> If requests are made to get a server's HA state before the server is fully 
> initialised the HA state ends up incorrect.
> I started Brooklyn with this command: 
> {{brooklyn launch --persist disabled}}
> I happened to have the jsgui open in my browser from a previous session. 
> The HA manager appeared to enter an invalid state:
> {code}
> sam@v:~/code/brooklyn.io/brooklyn (master $)
> $ http :8081/v1/server/ha/state
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store
> Content-Encoding: gzip
> Content-Type: application/json
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Expires: 0
> Pragma: no-cache
> Server: Jetty(8.1.17.v20150415)
> Set-Cookie: JSESSIONID=12nhcq9l0tmll1abkqmaorn3lp;Path=/
> Transfer-Encoding: chunked
> Vary: Accept-Encoding
> "MASTER"
> sam@v:~/code/brooklyn.io/brooklyn (master $)
> $ http :8081/v1/server/ha/states
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store
> Content-Encoding: gzip
> Content-Type: application/json
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Expires: 0
> Pragma: no-cache
> Server: Jetty(8.1.17.v20150415)
> Set-Cookie: JSESSIONID=8u4e6sv9f6h2g7xee0vsym92;Path=/
> Transfer-Encoding: chunked
> Vary: Accept-Encoding
> {
> "links": {},
> "masterId": null,
> "nodes": {},
> "ownId": "iuIF5Nlr"
> }
> {code}
> The debug log contains the following messages:
> {code}
> 2015-08-24 11:14:52,433 DEBUG o.a.b.l.BrooklynLauncher [main]: Starting 
> Brooklyn using security properties: BrooklynProperties[1]
> 2015-08-24 11:14:52,433 DEBUG o.a.b.l.BrooklynLauncher [main]: Starting 
> Brooklyn web-console with bindAddress 0.0.0.0/0.0.0.0 and properties 
> BrooklynProperties[480]
> 2015-08-24 11:14:52,829 DEBUG o.a.b.l.BrooklynWebServer [main]: Starting 
> Brooklyn console at http://127.0.0.1:8081/, running classpath://brooklyn.war 
> and []
> 2015-08-24 11:14:53,363 INFO  c.s.j.s.i.a.WebApplicationImpl [main]: 
> Initiating Jersey application, version 'Jersey: 1.18.1 02/19/2014 03:28 AM'
> 2015-08-24 11:14:54,405 INFO  o.a.b.r.s.p.DelegatingSecurityProvider 
> [brooklyn-jetty-server-8081-qtp1643988252-22]: REST using security provider 
> org.apache.brooklyn.rest.security.provider.AnyoneSecurityProvider
> 2015-08-24 11:14:54,426 WARN  o.a.b.r.f.HaHotCheckResourceFilter 
> [brooklyn-jetty-server-8081-qtp1643988252-21]: Disallowing web request as 
> server not in required startup-completed state: 
> com.sun.jersey.spi.container.ContainerRequest@7c320b37/AbstractResourceMethod(LocationApi#list)
>  (caller should set 'Brooklyn-Allow-Non-Master-Access' to force)
> 2015-08-24 11:14:54,426 WARN  o.a.b.r.f.HaHotCheckResourceFilter 
> [brooklyn-jetty-server-8081-qtp1643988252-22]: Disallowing web request as 
> server not in required startup-completed state: 
> com.sun.jersey.spi.container.ContainerRequest@5595c2ac/AbstractResourceMethod(ApplicationApi#list)
>  (caller should set 'Brooklyn-Allow-Non-Master-Access' to force)
> 2015-08-24 11:14:54,427 DEBUG o.a.b.c.m.h.HighAvailabilityManagerImpl 
> [brooklyn-jetty-server-8081-qtp1643988252-23]: High availablity manager has 
> no persister; returning empty record
> ...
> 2015-08-24 11:14:54,602 INFO  o.a.b.l.BrooklynLauncher [main]: Persistence 
> disabled
> 2015-08-24 11:14:54,602 INFO  o.a.b.l.BrooklynLauncher [main]: High 
> availability disabled
> 2015-08-24 11:14:54,602 DEBUG o.a.b.l.BrooklynLauncher [main]: Loading 
> catalog as part of launch sequence (it was not loaded as part of any rebind 
> sequence)
> {code}
> The message "High availablity manager has no persister" is logged by 
> HighAvailabilityManagerImpl in this code:
> {code:java}
> private ManagementPlaneSyncRecord 
> loadManagementPlaneSyncRecordInternal(boolean useLocalKnowledgeForThisNode) {
> if (disabled) {
> // if HA is disabled, then we are the only node - no persistence; 
> just load a memento to describe this node
> Builder builder = ManagementPlaneSyncRecordImpl.builder()
> .node(createManagementNodeSyncRecord(true));
> if (getTransitionTargetNodeState() == ManagementNodeState.MASTER) 
> {
> builder.masterNodeId(ownNodeId);
> }
> return builder.build();
> }
> if (persister == null) {
> // e.g. web-console may be polling 

[GitHub] brooklyn-server pull request #925: Fix reporting of master ID when web API u...

2018-01-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/925


---


[jira] [Commented] (BROOKLYN-167) HighAvailabilityManagerImpl has invalid state if /v1/server/ha/states requested before BrooklynLauncher has fully initialised a server

2018-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/BROOKLYN-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16309475#comment-16309475
 ] 

ASF GitHub Bot commented on BROOKLYN-167:
-

Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/925


> HighAvailabilityManagerImpl has invalid state if /v1/server/ha/states 
> requested before BrooklynLauncher has fully initialised a server
> --
>
> Key: BROOKLYN-167
> URL: https://issues.apache.org/jira/browse/BROOKLYN-167
> Project: Brooklyn
>  Issue Type: Bug
>Reporter: Sam Corbett
>
> If requests are made to get a server's HA state before the server is fully 
> initialised the HA state ends up incorrect.
> I started Brooklyn with this command: 
> {{brooklyn launch --persist disabled}}
> I happened to have the jsgui open in my browser from a previous session. 
> The HA manager appeared to enter an invalid state:
> {code}
> sam@v:~/code/brooklyn.io/brooklyn (master $)
> $ http :8081/v1/server/ha/state
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store
> Content-Encoding: gzip
> Content-Type: application/json
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Expires: 0
> Pragma: no-cache
> Server: Jetty(8.1.17.v20150415)
> Set-Cookie: JSESSIONID=12nhcq9l0tmll1abkqmaorn3lp;Path=/
> Transfer-Encoding: chunked
> Vary: Accept-Encoding
> "MASTER"
> sam@v:~/code/brooklyn.io/brooklyn (master $)
> $ http :8081/v1/server/ha/states
> HTTP/1.1 200 OK
> Cache-Control: no-cache, no-store
> Content-Encoding: gzip
> Content-Type: application/json
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Expires: 0
> Pragma: no-cache
> Server: Jetty(8.1.17.v20150415)
> Set-Cookie: JSESSIONID=8u4e6sv9f6h2g7xee0vsym92;Path=/
> Transfer-Encoding: chunked
> Vary: Accept-Encoding
> {
> "links": {},
> "masterId": null,
> "nodes": {},
> "ownId": "iuIF5Nlr"
> }
> {code}
> The debug log contains the following messages:
> {code}
> 2015-08-24 11:14:52,433 DEBUG o.a.b.l.BrooklynLauncher [main]: Starting 
> Brooklyn using security properties: BrooklynProperties[1]
> 2015-08-24 11:14:52,433 DEBUG o.a.b.l.BrooklynLauncher [main]: Starting 
> Brooklyn web-console with bindAddress 0.0.0.0/0.0.0.0 and properties 
> BrooklynProperties[480]
> 2015-08-24 11:14:52,829 DEBUG o.a.b.l.BrooklynWebServer [main]: Starting 
> Brooklyn console at http://127.0.0.1:8081/, running classpath://brooklyn.war 
> and []
> 2015-08-24 11:14:53,363 INFO  c.s.j.s.i.a.WebApplicationImpl [main]: 
> Initiating Jersey application, version 'Jersey: 1.18.1 02/19/2014 03:28 AM'
> 2015-08-24 11:14:54,405 INFO  o.a.b.r.s.p.DelegatingSecurityProvider 
> [brooklyn-jetty-server-8081-qtp1643988252-22]: REST using security provider 
> org.apache.brooklyn.rest.security.provider.AnyoneSecurityProvider
> 2015-08-24 11:14:54,426 WARN  o.a.b.r.f.HaHotCheckResourceFilter 
> [brooklyn-jetty-server-8081-qtp1643988252-21]: Disallowing web request as 
> server not in required startup-completed state: 
> com.sun.jersey.spi.container.ContainerRequest@7c320b37/AbstractResourceMethod(LocationApi#list)
>  (caller should set 'Brooklyn-Allow-Non-Master-Access' to force)
> 2015-08-24 11:14:54,426 WARN  o.a.b.r.f.HaHotCheckResourceFilter 
> [brooklyn-jetty-server-8081-qtp1643988252-22]: Disallowing web request as 
> server not in required startup-completed state: 
> com.sun.jersey.spi.container.ContainerRequest@5595c2ac/AbstractResourceMethod(ApplicationApi#list)
>  (caller should set 'Brooklyn-Allow-Non-Master-Access' to force)
> 2015-08-24 11:14:54,427 DEBUG o.a.b.c.m.h.HighAvailabilityManagerImpl 
> [brooklyn-jetty-server-8081-qtp1643988252-23]: High availablity manager has 
> no persister; returning empty record
> ...
> 2015-08-24 11:14:54,602 INFO  o.a.b.l.BrooklynLauncher [main]: Persistence 
> disabled
> 2015-08-24 11:14:54,602 INFO  o.a.b.l.BrooklynLauncher [main]: High 
> availability disabled
> 2015-08-24 11:14:54,602 DEBUG o.a.b.l.BrooklynLauncher [main]: Loading 
> catalog as part of launch sequence (it was not loaded as part of any rebind 
> sequence)
> {code}
> The message "High availablity manager has no persister" is logged by 
> HighAvailabilityManagerImpl in this code:
> {code:java}
> private ManagementPlaneSyncRecord 
> loadManagementPlaneSyncRecordInternal(boolean useLocalKnowledgeForThisNode) {
> if (disabled) {
> // if HA is disabled, then we are the only node - no persistence; 
> just load a memento to describe this node
> Builder builder = ManagementPlaneSyncRecordImpl.builder()
> .node(createManagementNodeSyncRecord(true));
> if (getTransitionTargetNodeState() == ManagementNodeState.MASTER) 
> {
> builder.masterNodeId(ownNodeId);
> }
>   

[GitHub] brooklyn-server issue #923: DynamicCluster: resize to maxSize, before throwi...

2018-01-03 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/923
  
makes sense to resize as much as we can, but 100% agree re giving more 
feedback to user.

a highlight might be nice but not sure how to clear it.  the right thing 
feels like being able to report log messages that happen during execution.  i 
think accept the pain for now until we can collect and include log messages for 
tasks.




---


[GitHub] brooklyn-server pull request #923: DynamicCluster: resize to maxSize, before...

2018-01-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/brooklyn-server/pull/923


---


[GitHub] brooklyn-server issue #925: Fix reporting of master ID when web API used bef...

2018-01-03 Thread ahgittin
Github user ahgittin commented on the issue:

https://github.com/apache/brooklyn-server/pull/925
  
LGTM.  Client-side fix in https://github.com/apache/brooklyn-ui/pull/51 
which could also be merged but this change is better.


---


[GitHub] brooklyn-ui pull request #51: if not using persistence and mgmt plane ID is ...

2018-01-03 Thread ahgittin
GitHub user ahgittin opened a pull request:

https://github.com/apache/brooklyn-ui/pull/51

if not using persistence and mgmt plane ID is null, UI can give erroneous 
error

fix it by accepting null plane as acceptable if server is otherwise healthy

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ahgittin/brooklyn-ui 
forgive-null-in-mgmt-record

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/brooklyn-ui/pull/51.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 #51


commit f9760b9b3f1994e46143283c32ebf5d6cd836ff6
Author: Alex Heneveld 
Date:   2018-01-03T10:48:36Z

if not using persistence and mgmt plane ID is null, UI can give erroneous 
error




---


[GitHub] brooklyn-server issue #916: DynamicCluster's max size applies to all calls t...

2018-01-03 Thread tbouron
Github user tbouron commented on the issue:

https://github.com/apache/brooklyn-server/pull/916
  
@aledsage I agree with @nakomis and @sjcorbett. I this logic should be 
implemented in the client (UI/CLI) to deal with a 
`InsufficientCapacityException` by proposing to resize to the max capacity 
rather than the desired one.


---


[GitHub] brooklyn-server issue #916: DynamicCluster's max size applies to all calls t...

2018-01-03 Thread nakomis
Github user nakomis commented on the issue:

https://github.com/apache/brooklyn-server/pull/916
  
@aledsage regarding resizing up to `maxSize`, I'd favour @sjcorbett's 
approach of throwing the `InsufficientCapacityException` and leaving it up to 
the consumer to re-try. Requesting a new size of X, and getting a new size of Y 
just feels a bit too much like hidden magic


---


Jenkins build is back to normal : brooklyn-master-build-docker #123

2018-01-03 Thread Apache Jenkins Server
See