Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9130

DocumentDiscoveryLiteService.hasBacklog logging regression (inverted version check)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.13, 1.22.0, 1.32.0
    • 1.34.0, 1.22.6
    • documentmk
    • None

    Description

      It looks like OAK-8139 has introduced a regression in the version check logic of DocumentDiscoveryLiteService.hasBacklog :

      Before the change the logic was:

                          Version actual = Version.parseVersion((String) oakVersion);
                          Version introduced = Version.parseVersion("1.3.5");
                          if (actual.compareTo(introduced)>=0) {
                              warn = true;
                          }
      

      After the change the logis is:

                          warn = versionPredates("1.3.5", (String) oakVersion);
      

      with versionPredates logic as follows:

          static boolean versionPredates(String base, String compare) {
              Version one = Version.parseVersion(substSnapshotPrefix(compare));
              Version two = Version.parseVersion(substSnapshotPrefix(base));
              return two.compareTo(one) > 0;
          }
      

      The behaviour of versionPredates can eg. be easily seen in the test:

      assertTrue(DocumentDiscoveryLiteService.versionPredates("1.3.5", "1.0.0"));
      

      So before the change the log.warn would be issued for versions newer or equal to 1.3.5, where as after the change the log.warn is issued for versions lower than 1.3.5.

      This inverts only the log.warn filtering with no other side-effects.

      /cc reschke

      Attachments

        1. OAK-9130.patch.v0.txt
          0.9 kB
          Stefan Egli

        Issue Links

          Activity

            People

              stefanegli Stefan Egli
              stefanegli Stefan Egli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: