sergey-chugunov-1985 commented on code in PR #12178: URL: https://github.com/apache/ignite/pull/12178#discussion_r2235948133
########## modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java: ########## @@ -504,6 +505,46 @@ public void storeEnabled(boolean storeEnabled) { return storeEnabled() && txState().storeWriteThrough(cctx); } + /** + * Clears tx entries if they could be re-read from a read-through {@link CacheStore}. + * <p> + * This method takes effect only if all Ignite caches involved into transaction configured with CacheStores in + * read-through mode. + */ + protected void clearCacheStoreBackedEntries() { + if (txState().cacheIds() == null) + return; + + GridIntIterator iter = txState().cacheIds().iterator(); + while (iter.hasNext()) { + int cacheId = iter.next(); + + if (cctx.cacheContext(cacheId) == null) Review Comment: I removed this null check as it indeed looks redundant. About not read-through caches. It is possible of cource to clear all involved caches unconditionally but I tried to avoid touching caches that are not backed by CacheStore thus we cannot recover their values easily. That was my motivation. But it is possible to clear only read-through caches and leave all others - do you think it is a better idea? Clear only the data you can easily recover. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org