Fixing potential NullPointerException during KahaDB index recovery.
This commit is contained in:
Christopher L. Shannon (cshannon) 2015-11-25 16:02:52 +00:00
parent 35b7ac250b
commit 8f30866fdf
1 changed files with 8 additions and 6 deletions

View File

@ -762,12 +762,14 @@ public abstract class MessageDatabase extends ServiceSupport implements BrokerSe
for (Long sequenceId : matches) {
MessageKeys keys = sd.orderIndex.remove(tx, sequenceId);
sd.locationIndex.remove(tx, keys.location);
sd.messageIdIndex.remove(tx, keys.messageId);
metadata.producerSequenceIdTracker.rollback(keys.messageId);
undoCounter++;
decrementAndSubSizeToStoreStat(key, keys.location.getSize());
// TODO: do we need to modify the ack positions for the pub sub case?
if (keys != null) {
sd.locationIndex.remove(tx, keys.location);
sd.messageIdIndex.remove(tx, keys.messageId);
metadata.producerSequenceIdTracker.rollback(keys.messageId);
undoCounter++;
decrementAndSubSizeToStoreStat(key, keys.location.getSize());
// TODO: do we need to modify the ack positions for the pub sub case?
}
}
}