[ 
https://issues.apache.org/jira/browse/GEODE-7830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17052611#comment-17052611
 ] 

Darrel Schneider commented on GEODE-7830:
-----------------------------------------

I think what I was missing was that you are not calling rebalance because you 
know you have some resources to rebalance but just in case you do. I think you 
are right that this could be a common use case for rebalance: "if anything in 
the cluster is out of balance fix it otherwise don't do anything". I agree that 
this makes sense for a rebalance that did not target a specific region.

> Management REST API rebalance endpoints return confusing operationResults
> -------------------------------------------------------------------------
>
>                 Key: GEODE-7830
>                 URL: https://issues.apache.org/jira/browse/GEODE-7830
>             Project: Geode
>          Issue Type: Bug
>          Components: management
>            Reporter: Aaron Lindsey
>            Assignee: Darrel Schneider
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> We observed odd behavior regarding the operationResult object returned in the 
> rebalance API:
> # It contains success=false if the cluster has no regions or has no servers. 
> This is confusing because the rebalance didn't fail — it just didn't have 
> anything to rebalance so it was basically a no-op. As a consumer of this API, 
> I need to be able to distinguish between "real" failures and this "no-op" 
> failure, and I should not have to write code to parse the "statusMessage" to 
> do that.
> # Sometimes, success=true and other times success=false for the same 
> statusMessage: "Distributed system has no regions that can be rebalanced." 
> This is confusing because I don't know why it sometimes considers this a 
> failure and other times considers it a success. If #1 above is fixed, then 
> this would not be an issue because it would always return success=true for 
> this particular statusMessage.
> Here is an example of two confusing operationResults we observed:
> {code:json}
> {
>   "result": [
>     {
>       "statusCode": "OK",
>       "links": {
>         "self": 
> "http://geodecluster-sample-locator.default/management/v1/operations/rebalances/15dfe6ef-acaf-4a45-9b55-1d855a977ba8";,
>         "list": 
> "http://geodecluster-sample-locator.default/management/v1/operations/rebalances";
>       },
>       "operationStart": "2020-02-25T18:53:34.058Z",
>       "operationEnd": "2020-02-25T18:53:34.063Z",
>       "operationId": "15dfe6ef-acaf-4a45-9b55-1d855a977ba8",
>       "operation": {
>         "simulate": false
>       },
>       "operationResult": {
>         "statusMessage": "Distributed system has no regions that can be 
> rebalanced.",
>         "success": true
>       }
>     },
>     {
>       "statusCode": "OK",
>       "links": {
>         "self": 
> "http://geodecluster-sample-locator.default/management/v1/operations/rebalances/8218ce0d-e3b8-4c49-b925-665a28e821c3";,
>         "list": 
> "http://geodecluster-sample-locator.default/management/v1/operations/rebalances";
>       },
>       "operationStart": "2020-02-25T18:53:45.650Z",
>       "operationEnd": "2020-02-25T18:53:45.654Z",
>       "operationId": "8218ce0d-e3b8-4c49-b925-665a28e821c3",
>       "operation": {
>         "simulate": false
>       },
>       "operationResult": {
>         "statusMessage": "Distributed system has no regions that can be 
> rebalanced.",
>         "success": false
>       }
>     }
>   ],
>   "statusCode": "OK"
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to