Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-8777

REST: metadata command failed on cluster of size 1.

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: rest
    • Labels:

      Description

      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:

      ...
      for (int i = 1; i < subgrid.size(); i++) {
       ....
      }
      
      if (map.isEmpty())
                          throw new IgniteException("Failed to request meta data. " + cacheName + " is not found");
      ...
      

      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".

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Chandresh Pancholi Chandresh Pancholi
                Reporter:
                kuaw26 Alexey Kuznetsov
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: