Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-4252

Improve confusing log message that prints exception when editlog read is completed

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.1.2
    • Component/s: namenode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Target Version/s:

      Description

      Namenode prints a log with an exception to indicate successful completion of reading of logs. This causes misunderstanding where people have interpreted it as failure to load editlog. The log message could be better.

        Issue Links

          Activity

          Hide
          Matt Foley added a comment -

          Closed upon successful release of 1.1.2.

          Show
          Matt Foley added a comment - Closed upon successful release of 1.1.2.
          Hide
          Suresh Srinivas added a comment -

          I committed the patch to both branch-1 and branch-1.1.

          Show
          Suresh Srinivas added a comment - I committed the patch to both branch-1 and branch-1.1.
          Hide
          Suresh Srinivas added a comment -

          +1 for the patch. It is fairly trivial log change. So I am fine with the change not having tests.

          Show
          Suresh Srinivas added a comment - +1 for the patch. It is fairly trivial log change. So I am fine with the change not having tests.
          Hide
          Suresh Srinivas added a comment - - edited

          Current code:

                  try {
                    opcode = in.readByte();
                    if (opcode == OP_INVALID) {
                      LOG.info("Invalid opcode, reached end of edit log " +
                                 "Number of transactions found: " + numEdits + ".  " +
                                 "Bytes read: " + tracker.getPos());
                      break; // no more transactions
                    }
                  } catch (EOFException e) {
                    LOG.info("Reading " + edits.getName() + ": " + e);
                    break; // no more transactions
                  }
          

          On catching exception we should print the same log as we print when encountering OP_INVALID in the above code. Printing EOF does not make sense, as it is expected and handled correctly as end of file.

          Show
          Suresh Srinivas added a comment - - edited Current code: try { opcode = in.readByte(); if (opcode == OP_INVALID) { LOG.info("Invalid opcode, reached end of edit log " + "Number of transactions found: " + numEdits + ". " + "Bytes read: " + tracker.getPos()); break; // no more transactions } } catch (EOFException e) { LOG.info("Reading " + edits.getName() + ": " + e); break; // no more transactions } On catching exception we should print the same log as we print when encountering OP_INVALID in the above code. Printing EOF does not make sense, as it is expected and handled correctly as end of file.

            People

            • Assignee:
              Jing Zhao
              Reporter:
              Suresh Srinivas
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development