Skip to content

Commit

Permalink
GG-21389 Flush records on cache stop
Browse files Browse the repository at this point in the history
  • Loading branch information
dgovorukhin committed Jul 22, 2019
1 parent d0e290f commit d8753ae
Showing 1 changed file with 18 additions and 8 deletions.
Expand Up @@ -1532,16 +1532,26 @@ private void stopCache(GridCacheAdapter<?, ?> cache, boolean cancel, boolean des

U.stopLifecycleAware(log, lifecycleAwares(ctx.group(), cache.configuration(), ctx.store().configuredStore()));

IgnitePageStoreManager pageStore;
try {
IgniteWriteAheadLogManager wal;

if (destroy && (pageStore = sharedCtx.pageStore()) != null) {
try {
if ((wal = sharedCtx.wal()) != null)
wal.flush(null, false);
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to flush WAL data while destroying cache" +
"[cache=" + ctx.name() + "]", e);
}

try {
IgnitePageStoreManager pageStore;

if (destroy && (pageStore = sharedCtx.pageStore()) != null)
pageStore.removeCacheData(new StoredCacheData(ctx.config()));
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to delete cache configuration data while destroying cache" +
"[cache=" + ctx.name() + "]", e);
}
}
catch (IgniteCheckedException e) {
U.error(log, "Failed to delete cache configuration data while destroying cache" +
"[cache=" + ctx.name() + "]", e);
}

if (log.isInfoEnabled()) {
Expand Down

0 comments on commit d8753ae

Please sign in to comment.