You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (Updated) (JIRA)" <ji...@apache.org> on 2011/10/31 16:13:32 UTC

[jira] [Updated] (BOOKKEEPER-50) NullPointException at LedgerDescriptor#cmpMasterKey

     [ https://issues.apache.org/jira/browse/BOOKKEEPER-50?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo updated BOOKKEEPER-50:
--------------------------------

    Attachment: BookieReadAfterBookieRestartTest.java

Add a test case to reproduce this issue.

2011-10-31 23:08:29,970 - WARN  - [NIOServerFactory:NIOServerFactory@123] - Exception in server socket loop: /0.0.0.0
java.lang.NullPointerException
     at org.apache.bookkeeper.bookie.LedgerDescriptor.cmpMasterKey(LedgerDescriptor.java:52)
     at org.apache.bookkeeper.bookie.Bookie.addEntry(Bookie.java:535)
     at org.apache.bookkeeper.proto.BookieServer.processPacket(BookieServer.java:174)
     at org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.readRequest(NIOServerFactory.java:309)
     at org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.doIO(NIOServerFactory.java:207)
     at org.apache.bookkeeper.proto.NIOServerFactory.run(NIOServerFactory.java:118)
2011-10-31 23:08:29,969 - WARN  - [NIOServerFactory:NIOServerFactory@123] - Exception in server socket loop: /0.0.0.0
java.lang.NullPointerException
     at org.apache.bookkeeper.bookie.LedgerDescriptor.cmpMasterKey(LedgerDescriptor.java:52)
     at org.apache.bookkeeper.bookie.Bookie.addEntry(Bookie.java:535)
     at org.apache.bookkeeper.proto.BookieServer.processPacket(BookieServer.java:174)
     at org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.readRequest(NIOServerFactory.java:309)
     at org.apache.bookkeeper.proto.NIOServerFactory$Cnxn.doIO(NIOServerFactory.java:207)
     at org.apache.bookkeeper.proto.NIOServerFactory.run(NIOServerFactory.java:118)

1) first add entries to a ledger (not close the ledger)
2) restart bookies, bookie relay journals during start up. the entries will be added without master key
3) open the ledger created by 1). so it will do recovery work and add last entry to bookie and got NullPointException.
                
> NullPointException at LedgerDescriptor#cmpMasterKey
> ---------------------------------------------------
>
>                 Key: BOOKKEEPER-50
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-50
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-server
>    Affects Versions: 3.4.0
>            Reporter: xulei
>         Attachments: BookieReadAfterBookieRestartTest.java, bookkeeper-50.patch
>
>
> the LedgerDescriptor will be created when it is missed in LedgerCache. NullPointException will be thrown out in the following case:
> 1. The ledger descriptor is created and cached to LedgerCache because of a readEntry operation in bookie. The ledger descriptor was created without setting master key (we don't know master key in a read request)
> 2. An addEntry is sent after 1 . since the ledger descriptor has been cached, so addEntry will use it to compare master key. then NullPointException is thrown out.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira