In order to release from cache we first peek, then save, then release
private static boolean cachePersistAndReleaseNext(Tangle tangle, Cache<Indexable, TransactionViewModel> cache) throws Exception {
Indexable hash = cache.getNextReleaseKey();
TransactionViewModel tvm = cache.get(hash);
if (tvm != null && tvm.shouldPersist()) {
//We update and cache this item again so that in the case where this released item is brought back from
// weakStore, it does not write to DB again.
tvm.setShouldPersist(false);
cache.put(hash, tvm);
tangle.save(tvm.getTransaction(), hash);
}
return cache.releaseNext();
}
However due to a context switches and multi-threading between peek and releaseNext() may not use the same hash 1.9.0
Bug description
In order to release from cache we first peek, then save, then release
However due to a context switches and multi-threading between peek and releaseNext() may not use the same hash 1.9.0
IRI version
1.9.0