if (!grp.localWalEnabled()) grp.localWalEnabled(true);
", WALState=" + grp.walEnabled() + ", parts=" + parts); if (hasOwning && !grp.localWalEnabled()) { grpsToEnableWal.add(grp.groupId()); else if (hasMoving && !hasOwning && grp.localWalEnabled()) { grpsToDisableWal.add(grp.groupId()); else if (!grp.localWalEnabled()) grpsWithWalDisabled.add(grp.groupId()); cctx.cache().cacheGroup(grpId).localWalEnabled(true); cctx.cache().cacheGroup(grpId).localWalEnabled(false);
/** * @param nodeId Node id. * @param p Partition number. */ private void partitionDone(UUID nodeId, int p, boolean updateState) { synchronized (this) { if (updateState && grp.localWalEnabled()) grp.topology().own(grp.topology().localPartition(p)); if (isDone()) return; if (grp.eventRecordable(EVT_CACHE_REBALANCE_PART_LOADED)) rebalanceEvent(p, EVT_CACHE_REBALANCE_PART_LOADED, exchId.discoveryEvent()); IgniteDhtDemandedPartitionsMap parts = remaining.get(nodeId); assert parts != null : "Remaining not found [grp=" + grp.cacheOrGroupName() + ", fromNode=" + nodeId + ", part=" + p + "]"; boolean rmvd = parts.remove(p); assert rmvd : "Partition already done [grp=" + grp.cacheOrGroupName() + ", fromNode=" + nodeId + ", part=" + p + ", left=" + parts + "]"; if (parts.isEmpty()) { int remainingRoutines = remaining.size() - 1; U.log(log, "Completed " + ((remainingRoutines == 0 ? "(final) " : "") + "rebalancing [grp=" + grp.cacheOrGroupName() + ", supplier=" + nodeId + ", topVer=" + topologyVersion() + ", progress=" + (routines - remainingRoutines) + "/" + routines + "]")); remaining.remove(nodeId); } checkIsDone(); } }
if (!grp.localWalEnabled()) fut.listen(new IgniteInClosureX<IgniteInternalFuture<Boolean>>() { @Override public void applyx(IgniteInternalFuture<Boolean> future) throws IgniteCheckedException {
/** * @throws Exception If failed. */ @Test public void testDataClearedAfterRestartWithDisabledWal() throws Exception { Assume.assumeFalse("https://issues.apache.org/jira/browse/IGNITE-10421", MvccFeatureChecker.forcedMvcc()); Ignite ignite = startGrid(0); ignite.cluster().active(true); IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME); int keysCnt = getKeysCount(); for (int k = 0; k < keysCnt; k++) cache.put(k, k); IgniteEx newIgnite = startGrid(1); newIgnite.cluster().setBaselineTopology(2); // Await fully exchange complete. awaitExchange(newIgnite); CacheGroupContext grpCtx = newIgnite.cachex(DEFAULT_CACHE_NAME).context().group(); assertFalse(grpCtx.localWalEnabled()); stopGrid(1); stopGrid(0); newIgnite = startGrid(1); newIgnite.cluster().active(true); newIgnite.cluster().setBaselineTopology(newIgnite.cluster().nodes()); cache = newIgnite.cache(DEFAULT_CACHE_NAME); for (int k = 0; k < keysCnt; k++) assertFalse("k=" + k +", v=" + cache.get(k), cache.containsKey(k)); }
if (!grp.localWalEnabled()) grp.localWalEnabled(true);
", WALState=" + grp.walEnabled() + ", parts=" + parts); if (hasOwning && !grp.localWalEnabled()) { grpsToEnableWal.add(grp.groupId()); else if (hasMoving && !hasOwning && grp.localWalEnabled()) { grpsToDisableWal.add(grp.groupId()); else if (!grp.localWalEnabled()) grpsWithWalDisabled.add(grp.groupId()); cctx.cache().cacheGroup(grpId).localWalEnabled(true); cctx.cache().cacheGroup(grpId).localWalEnabled(false);
if (updateState && grp.localWalEnabled()) grp.topology().own(grp.topology().localPartition(p));
if (!grp.localWalEnabled()) fut.listen(new IgniteInClosureX<IgniteInternalFuture<Boolean>>() { @Override public void applyx(IgniteInternalFuture<Boolean> future) throws IgniteCheckedException {