BUG-5280: fix NPE during transaction purge
Read/write transactions which transition to ready state
throw away their open transaction, which causes the following
exception:
Shard - member-1-shard-people-testTransactionChainWithMultipleShards: request Envelope{sessionId=1, txSequence=11, message=TransactionPurgeRequest{target=member-2-datastore-testTransactionChainWithMultipleShards-fe-0-chn-1-txn-2-2, sequence=2, replyTo=Actor[akka://cluster-test@127.0.0.1:2559/user/$a#-
493460599]}} caused failure
java.lang.NullPointerException
at org.opendaylight.controller.cluster.datastore.FrontendReadWriteTransaction.purge(FrontendReadWriteTransaction.java:113)
at org.opendaylight.controller.cluster.datastore.AbstractFrontendHistory.handleTransactionRequest(AbstractFrontendHistory.java:114)
at org.opendaylight.controller.cluster.datastore.LeaderFrontendState.handleTransactionRequest(LeaderFrontendState.java:197)
at org.opendaylight.controller.cluster.datastore.Shard.handleRequest(Shard.java:413)
at org.opendaylight.controller.cluster.datastore.Shard.handleNonRaftCommand(Shard.java:277)
Rework purge logic to talk directly to the data tree, which
prevents this from happening and simplifies the code a bit.
Change-Id: I7cc08687648d2473a712c171944a06307e4d8f9f
Signed-off-by: Robert Varga <rovarga@cisco.com>