Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3039

TxnLogToolkit uses Scanner badly

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      If more than 1 CRC error is found in the Txn log file, TxnLogToolkit fails to get an answer for the second one, because it has already closed the Scanner which was probably closed the input stream also, so exception is thrown:

      ZooKeeper Transactional Log File with dbid 0 txnlog format version 2
      CRC ERROR - 4/5/18 5:16:05 AM PDT session 0x16295bafcc40000 cxid 0x1 zxid 0x100000002 closeSession null
      Would you like to fix it (Yes/No/Abort) ? y
      CRC ERROR - 4/5/18 5:17:34 AM PDT session 0x26295bafcc90000 cxid 0x0 zxid 0x200000001 closeSession null
      Would you like to fix it (Yes/No/Abort) ? Exception in thread "main" java.util.NoSuchElementException
      at java.util.Scanner.throwFor(Scanner.java:862)
      at java.util.Scanner.next(Scanner.java:1371)
      at org.apache.zookeeper.server.persistence.TxnLogToolkit.askForFix(TxnLogToolkit.java:208)
      at org.apache.zookeeper.server.persistence.TxnLogToolkit.dump(TxnLogToolkit.java:175)
      at org.apache.zookeeper.server.persistence.TxnLogToolkit.main(TxnLogToolkit.java:101)

      Attachments

        Activity

          People

            andor Andor Molnar
            andor Andor Molnar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m