// We have to send the response only after persistence has completed
final ShardDataTreeTransactionChain chain = tree.ensureTransactionChain(historyId, () -> {
LOG.debug("{}: persisted history {}", persistenceId, historyId);
- envelope.sendSuccess(new LocalHistorySuccess(historyId, request.getSequence()), tree.ticker().read() - now);
+ envelope.sendSuccess(new LocalHistorySuccess(historyId, request.getSequence()), tree.readTime() - now);
});
localHistories.put(historyId, LocalFrontendHistory.create(persistenceId, tree, chain));
}
LOG.debug("{}: purging history {}", persistenceId, id);
- purgedHistories.add(Range.singleton(UnsignedLong.fromLongBits(id.getHistoryId())));
+ final UnsignedLong ul = UnsignedLong.fromLongBits(id.getHistoryId());
+ purgedHistories.add(Range.closedOpen(ul, UnsignedLong.ONE.plus(ul)));
existing.purge(request.getSequence(), envelope, now);
return null;
}