Skip to content

Commit

Permalink
IGNITE-13808 Failure handling disabled for index validation. - Fixes #…
Browse files Browse the repository at this point in the history
…8535.

Signed-off-by: Sergey Chugunov <sergey.chugunov@gmail.com>
  • Loading branch information
ibessonov authored and sergey-chugunov-1985 committed Dec 4, 2020
1 parent dac3706 commit 6c78963
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.ignite.util;

import org.apache.ignite.failure.FailureHandler;
import org.apache.ignite.failure.StopNodeFailureHandler;
import org.junit.Test;

import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
Expand All @@ -42,6 +44,11 @@ public class GridCommandHandlerIndexingClusterByClassTest extends GridCommandHan
createAndFillCache(client, CACHE_NAME, GROUP_NAME);
}

/** {@inheritDoc} */
@Override protected FailureHandler getFailureHandler(String igniteInstanceName) {
return new StopNodeFailureHandler();
}

/**
* Tests --cache check_index_inline_sizes works in case of all indexes have the same inline size.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public abstract class BPlusTree<L, T extends L> extends DataStructure implements
/** Wrapper for tree pages operations. Noop by default. Override for test purposes. */
public static PageHandlerWrapper<Result> testHndWrapper = null;

/** */
public static final ThreadLocal<Boolean> suspendFailureDiagnostic = ThreadLocal.withInitial(() -> false);

/** Destroy msg. */
public static final String CONC_DESTROY_MSG = "Tree is being concurrently destroyed: ";

Expand Down Expand Up @@ -6130,7 +6133,7 @@ protected CorruptedTreeException corruptedTreeException(String msg, Throwable ca
* @param e Exception.
*/
protected void processFailure(FailureType failureType, Throwable e) {
if (failureProcessor != null)
if (failureProcessor != null && !suspendFailureDiagnostic.get())
failureProcessor.process(new FailureContext(failureType, e));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.apache.ignite.internal.processors.cache.persistence.CacheDataRow;
import org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager;
import org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager;
import org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree;
import org.apache.ignite.internal.processors.cache.persistence.tree.CorruptedTreeException;
import org.apache.ignite.internal.processors.cache.verify.GridNotIdleException;
import org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility;
Expand Down Expand Up @@ -771,7 +772,14 @@ private Future<Map<String, ValidateIndexesPartitionResult>> processIndexAsync(
return calcExecutor.submit(new Callable<Map<String, ValidateIndexesPartitionResult>>() {
/** {@inheritDoc} */
@Override public Map<String, ValidateIndexesPartitionResult> call() {
return processIndex(cacheCtxWithIdx, idleChecker);
BPlusTree.suspendFailureDiagnostic.set(true);

try {
return processIndex(cacheCtxWithIdx, idleChecker);
}
finally {
BPlusTree.suspendFailureDiagnostic.set(false);
}
}
});
}
Expand Down

0 comments on commit 6c78963

Please sign in to comment.