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

Fix NPE produced by a call from InternalTableImpl#enlistWithRetry()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 3.0
    • None

    Description

      I'm doing the following:

      1. Start a cluster of 3 nodes
      2. Create a table with 3 replicas and 1 partition
      3. Stop one node
      4. Make a snapshot on the leader of the partition (twice in a row) - I'm not sure this step is required to reproduce the issue
      5. Start the stopped node

      Then in this code
      private <R> CompletableFuture<R> enlistWithRetry(
      InternalTransaction tx,
      int partId,
      BiFunction<TablePartitionId, Long, ReplicaRequest> requestFunction,
      int attempts
      ) {
      CompletableFuture<R> result = new CompletableFuture<>();

      enlist(partId, tx).<R>thenCompose(
      primaryReplicaAndTerm -> {
      try {
      return replicaSvc.invoke(
      primaryReplicaAndTerm.get1(),
      requestFunction.apply((TablePartitionId) tx.commitPartition(), primaryReplicaAndTerm.get2())
      );
      primaryReplicaAndTerm turns out to contain null as first element, 1 as second element, which causes an NPE further. Probably, clusterNodeResolver returned null.

      This does not reproduce often, but I saw this a few times.

      Attachments

        Issue Links

          Activity

            People

              alapin Alexander Lapin
              rpuch Roman Puchkovskiy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: