[ https://issues.apache.org/jira/browse/IGNITE-8777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16511013#comment-16511013 ]
ASF GitHub Bot commented on IGNITE-8777: ---------------------------------------- GitHub user chandresh-pancholi opened a pull request: https://github.com/apache/ignite/pull/4181 IGNITE-8777: REST: metadata command failed on cluster of size 1 Signed-off-by: Chandresh Pancholi <chandreshpancholi...@gmail.com> You can merge this pull request into a Git repository by running: $ git pull https://github.com/chandresh-pancholi/ignite master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/4181.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 #4181 ---- commit 682ed08ca9980c8f267c85358bb2ee829b4b3553 Author: Chandresh Pancholi <chandreshpancholi@...> Date: 2018-06-13T12:00:18Z IGNITE-8777: REST: metadata command failed on cluster of size 1 Signed-off-by: Chandresh Pancholi <chandreshpancholi...@gmail.com> ---- > REST: metadata command failed on cluster of size 1. > --------------------------------------------------- > > Key: IGNITE-8777 > URL: https://issues.apache.org/jira/browse/IGNITE-8777 > Project: Ignite > Issue Type: Improvement > Components: rest > Affects Versions: 2.5 > Reporter: Alexey Kuznetsov > Assignee: Chandresh Pancholi > Priority: Major > Labels: newbie > > Start *only one *node. > Execute REST command: > http://localhost:8080/ignite?cmd=getorcreate&cacheName=myNewPartionedCache&backups=2 > Cache will be created. > Execute > http://localhost:8080/ignite?cmd=metadata&cacheName=myNewPartionedCache > Error will be returned: {“successStatus”:1,“error”:“Failed to handle > request: [req=CACHE_METADATA, err=Failed to request meta data. > myNewPartionedCache is not found]“,”response”:null,“sessionToken”:null} > After some debug, I see in code GridCacheCommandHandler.MetadataTask#map: > {code} > ... > for (int i = 1; i < subgrid.size(); i++) { > .... > } > if (map.isEmpty()) > throw new IgniteException("Failed to request meta data. " > + cacheName + " is not found"); > ... > {code} > So, in case of cluster with only one node this code will throw exception. > I guess the fix should be - just replace "int i = 1" with "int i = 0". -- This message was sent by Atlassian JIRA (v7.6.3#76005)