Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-4591

Possible IndexOutOfBoundsException with delete query on bigger table

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.0-alpha, 4.14.0
    • Labels:
      None

      Description

      Here is the schema and inserted around 5million records.

      0: jdbc:phoenix:localhost> CREATE TABLE IF NOT EXISTS testTable ( ID BIGINT PRIMARY KEY , FirstName VARCHAR(30) , SecondName VARCHAR(30) , City VARCHAR(30) );
      No rows affected (2.283 seconds)
      0: jdbc:phoenix:localhost> CREATE INDEX secondary_index ON testTable (FirstName);
      No rows affected (7.275 seconds)
      

      Then delete from the table is throwing java.lang.IndexOutOfBoundsException

      0: jdbc:phoenix:localhost> delete from testtable;
      Error: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 (state=08000,code=101)
      org.apache.phoenix.exception.PhoenixIOException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:122)
      	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:970)
      	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:912)
      	at org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
      	at org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
      	at org.apache.phoenix.compile.DeleteCompiler$5.execute(DeleteCompiler.java:796)
      	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:394)
      	at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:377)
      	at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
      	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:376)
      	at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:364)
      	at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1738)
      	at sqlline.Commands.execute(Commands.java:822)
      	at sqlline.Commands.sql(Commands.java:732)
      	at sqlline.SqlLine.dispatch(SqlLine.java:813)
      	at sqlline.SqlLine.begin(SqlLine.java:686)
      	at sqlline.SqlLine.start(SqlLine.java:398)
      	at sqlline.SqlLine.main(SqlLine.java:291)
      Caused by: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
      	at java.util.concurrent.FutureTask.get(FutureTask.java:206)
      	at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:965)
      	... 16 more
      Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
      	at java.util.ArrayList.get(ArrayList.java:429)
      	at org.apache.phoenix.compile.DeleteCompiler.deleteRows(DeleteCompiler.java:225)
      	at org.apache.phoenix.compile.DeleteCompiler.access$000(DeleteCompiler.java:98)
      	at org.apache.phoenix.compile.DeleteCompiler$DeletingParallelIteratorFactory.mutate(DeleteCompiler.java:276)
      	at org.apache.phoenix.compile.MutatingParallelIteratorFactory.newIterator(MutatingParallelIteratorFactory.java:59)
      	at org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:121)
      	at org.apache.phoenix.iterate.ParallelIterators$1.call(ParallelIterators.java:113)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at org.apache.phoenix.job.JobManager$InstrumentedJobFutureTask.run(JobManager.java:183)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

        Attachments

        1. PHOENIX-4591.patch
          3 kB
          Rajeshbabu Chintaguntla

          Activity

            People

            • Assignee:
              rajeshbabu Rajeshbabu Chintaguntla
              Reporter:
              romil.choksi Romil Choksi
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: