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

Node fails to start with IndexOutOfBoundsException if metastorage nodes do not exist

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha2
    • 3.0.0-alpha3
    • None

    Description

      If a node is started with this config...

      {
          "node": {
              "metastorageNodes": [
                  "node-0", "node-1", "node-2"
              ]
          },
          "network": {
              "port": 3344,
              "netClusterNodes": [
                  "localhost:3344"
              ]
          }
      }
      

      but with a name that is not present in metastorageNodes...

      IgnitionManager.start("other-name", Files.readString(Path.of("config/ignite-config.json")))
      

      it fails with IndexOutOfBoundsException:

      INFO: Started replication server [node=ClusterNode [id=4640f6cd-f2c2-4fcf-9261-560b55190894, name=example-node, host=192.168.2.190, port=3344]]
      Exception in thread "main" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
      	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
      	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
      	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
      	at java.base/java.util.Objects.checkIndex(Objects.java:373)
      	at java.base/java.util.ArrayList.get(ArrayList.java:426)
      	at org.apache.ignite.internal.raft.Loza.startRaftGroup(Loza.java:76)
      	at org.apache.ignite.internal.metastorage.MetaStorageManager.<init>(MetaStorageManager.java:133)
      	at org.apache.ignite.internal.app.IgnitionImpl.start(IgnitionImpl.java:145)
      	at org.apache.ignite.app.IgnitionManager.start(IgnitionManager.java:45)
      	at org.apache.ignite.example.table.TableExample.main(TableExample.java:29)
      

      Should instead fail with a meaningful error message.

      Attachments

        Issue Links

          Activity

            People

              maliev Mirza Aliev
              vkulichenko Valentin Kulichenko
              Vyacheslav Koptilin Vyacheslav Koptilin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m