[ https://issues.apache.org/jira/browse/GEODE-7830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17051687#comment-17051687 ]
Darrel Schneider commented on GEODE-7830: ----------------------------------------- You are right that the operator could check to see if any regions were rebalanced. But couldn't the same argument be made that if we continue to report this as a failure that the operator could check to see if it a failure they are willing to ignore? So in either case, if you are willing to some extra checking, you could figure out that it was or was not an error. This part (what is and is not an error) of the rebalance implementation is shared by the new REST API and gfsh. The REST API is new and subject to change but gfsh rebalance has already been released. Since we already defined these no-op rebalances as an error I'm inclined to keep it that way unless we think this is a common use case. > 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)