Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13243

Correct initial capacity of ops

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 7.7
    • main (10.0), 9.2
    • None
    • None

    Description

      ElectionContext.java

      @Override
      void runLeaderProcess(boolean weAreReplacement, int pauseBeforeStartMs)
      throws KeeperException, InterruptedException, IOException {
      
      String parent = new Path(leaderPath).getParent().toString();
      try {
      RetryUtil.retryOnThrowable(NodeExistsException.class, 60000, 5000, () -> {
      synchronized (lock) {
      ........
      
      
      List<Op> ops = new ArrayList<>(2);       //HERE SHOULD BE 3 OR MORE
      
      
      
      ops.add(Op.check(leaderSeqPath, -1));
      ops.add(Op.create(leaderPath, Utils.toJSON(leaderProps), zkClient.getZkACLProvider().getACLsToAdd(leaderPath), CreateMode.EPHEMERAL));
      ops.add(Op.setData(parent, null, -1));
      List<OpResult> results;
      
      results = zkClient.multi(ops, true);
      .......
      }
      

       

      Attachments

        1. SOLR-13243.patch
          1 kB
          hu xiaodong

        Issue Links

          Activity

            People

              krisden Kevin Risden
              xiaodong.hu hu xiaodong
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 50m
                  50m