Andor Molnar created ZOOKEEPER-3039:
---------------------------------------
Summary: TxnLogToolkit uses Scanner badly
Key: ZOOKEEPER-3039
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3039
Project: ZooKeeper
Issue Type: Bug
Reporter: Andor Molnar
Assignee: Andor Molnar
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:
{noformat}
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){noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)