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

Issue with 'preallocation' feature in EntryLogger

Add voteWatch issue
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: 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

            • Assignee:
              reddycharan18@gmail.com Charan Reddy Guttapalem
              Reporter:
              reddycharan18@gmail.com Charan Reddy Guttapalem

              Dates

              • Created:
                Updated:

                Issue deployment