Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-933

OutOfBoundException in StorageService.getAllRanges

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.6.1
    • None
    • None
    • Low

    Description

      this was seen on 0.6-beta3 but it appears to be in trunk too, given the same code for getAllRanges. The problem appeared while accessing a bootstraping node via nodetool, giving the following stacktrace

      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1
      at java.util.ArrayList.get(ArrayList.java:324)
      at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
      at org.apache.cassandra.service.StorageService.getAllRanges(StorageService.java:1133)
      at org.apache.cassandra.service.StorageService.getRangeToAddressMap(StorageService.java:440)
      at org.apache.cassandra.service.StorageService.getRangeToEndPointMap(StorageService.java:431)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
      at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
      at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
      at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
      at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:262)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
      at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
      ...

      Basically, no test is performed for non-emptyness of the input token list. If such list should never be empty, I guess this should be explicit in the interface/javadoc, otherwise I'm attaching a patch & testcase (pretty silly code, but the test passes )

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            riffraff gabriele renzi Assign to me
            riffraff gabriele renzi
            gabriele renzi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified

                Slack

                  Issue deployment