Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4222

TieredMergePolicy.getFloorSegmentMB returns the wrong value

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.6.1, 4.0-BETA, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      public double getFloorSegmentMB() {
        return floorSegmentBytes/1024*1024.;
      }
      

      This is clearly wrong. It should be either "/1024/1024." or "/(1024*1024.)". As written, the / and * operations offset, so the value gets returned in bytes. The merge policy itself uses the value directly rather than calling this getter, so only the return value itself is wrong.

        Activity

        Hide
        mikemccand Michael McCandless added a comment -

        Nice catch Chris, I'll commit shortly!

        Show
        mikemccand Michael McCandless added a comment - Nice catch Chris, I'll commit shortly!
        Hide
        mikemccand Michael McCandless added a comment -

        Thanks Chris!

        Show
        mikemccand Michael McCandless added a comment - Thanks Chris!
        Hide
        thetaphi Uwe Schindler added a comment -

        Mike, can you please backport this one?

        Show
        thetaphi Uwe Schindler added a comment - Mike, can you please backport this one?
        Hide
        mikemccand Michael McCandless added a comment -

        Sure, I just committed rev 1362113.

        Show
        mikemccand Michael McCandless added a comment - Sure, I just committed rev 1362113.
        Hide
        thetaphi Uwe Schindler added a comment -

        Bulk close for 3.6.1

        Show
        thetaphi Uwe Schindler added a comment - Bulk close for 3.6.1

          People

          • Assignee:
            mikemccand Michael McCandless
            Reporter:
            cfuller@atlassian.com Chris Fuller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development