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

Broken logging in CopyOnWriteDirectory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.5, 1.8.17
    • Fix Version/s: 1.18.0, 1.8.18, 1.10.6
    • Component/s: lucene
    • Labels:
      None

      Description

      In trunk:

      oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnWriteDirectory.java
      437-                long remoteFileLength = remote.fileLength(name);
      438-                 validLocalCopyPresent = localFileLength == remoteFileLength;
      439-
      440-                 if (!validLocalCopyPresent) {
      441:                     log.warn("COWRemoteFileReference::file ({}) differs in length. local: {}; remote: {}, init-remote-length",
      442-                             name, localFileLength, remoteFileLength);
      443-                 }
      444-            } else if (!IndexCopier.REMOTE_ONLY.contains(name)) {
      445-                log.warn("COWRemoteFileReference::local file ({}) doesn't exist", name);
      

      (note the trailing "init-remote-length" that does not make any sense)

      Worse, in 1.10 and 1.8:

      oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnWriteDirectory.java
      426-                long remoteFileLength = remote.fileLength(name);
      427-                 validLocalCopyPresent = localFileLength == remoteFileLength;
      428-
      429-                 if (!validLocalCopyPresent) {
      430:                     log.warn("COWRemoteFileReference::file ({}) differs in length. local: {}; remote: {}, init-remote-length",
      431-                             localFileLength, remoteFileLength, length);
      432-                 }
      433-            } else if (!IndexCopier.REMOTE_ONLY.contains(name)) {
      434-                log.warn("COWRemoteFileReference::local file ({}) doesn't exist", name);
      

      (name parameter missing, so localFileLength is logged as filename)

      Proposal:

      • make this consistent everywhere
      • either mention "init-remote-length" and log the value, or remove it from the message
      • (and fix the identation

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thomasm Thomas Mueller
                Reporter:
                reschke Julian Reschke
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: