Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-1082

Issue with 'preallocation' feature in EntryLogger

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      With BOOKKEEPER-643 (https://github.com/apache/bookkeeper/commit/694568b0ff0d048c284c8d5db0c9455d30dfa3ce) feature, 'entryLogFilePreallocationEnabled' is introduced. But by the way it is handled, it looks like it can never be used.

      In EntryLoggerAllocator.createNewLog, even if entryLogPreAllocationEnabled is configured to true, else block is unreachable because ‘preallocation’ will always be null and it would end up with ‘if’ block. So effectively ‘entryLogFilePreallocationEnabled’ logic is broken.

      synchronized BufferedLogChannel createNewLog() throws IOException {
      BufferedLogChannel bc;
      if (!entryLogPreAllocationEnabled || null == preallocation)

      { // initialization time to create a new log bc = allocateNewLog(); }

      else {
      // has a preallocated entry log
      ......
      ......
      preallocation = allocatorExecutor.submit(new Callable<BufferedLogChannel>() { <-------- this is the only place where 'preallocation' is set and it is not possible to get into the else block in this method ------------>

      @Override
      public BufferedLogChannel call() throws IOException

      { return allocateNewLog(); }

      });
      }
      LOG.info("Created new entry logger {}.", bc.getLogId());
      return bc;
      }

      Attachments

        Activity

          People

            reddycharan18@gmail.com Charan Reddy Guttapalem
            reddycharan18@gmail.com Charan Reddy Guttapalem
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: