Skip to content

Commit

Permalink
GG-19362 Fix flaky GridCountDownCallbackTest
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-chudov committed Jun 24, 2019
1 parent be2b502 commit c836d4e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 198 deletions.
Expand Up @@ -108,4 +108,4 @@ public interface IgniteScheduler {
* @return Scheduled execution future.
*/
public <R> SchedulerFuture<R> scheduleLocal(@NotNull Callable<R> job, String ptrn);
}
}
Expand Up @@ -156,7 +156,6 @@
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
import org.apache.ignite.internal.metric.IoStatisticsHolderNoOp;
import org.apache.ignite.internal.util.GridConcurrentHashSet;
import org.apache.ignite.internal.util.GridCountDownCallback;
import org.apache.ignite.internal.util.GridMultiCollectionWrapper;
import org.apache.ignite.internal.util.GridReadOnlyArrayView;
import org.apache.ignite.internal.util.IgniteUtils;
Expand Down Expand Up @@ -1463,13 +1462,9 @@ private void prepareIndexRebuildFuture(int cacheId) {
@Override public void rebuildIndexesIfNeeded(GridDhtPartitionsExchangeFuture fut) {
GridQueryProcessor qryProc = cctx.kernalContext().query();

if (qryProc.moduleEnabled()) {
GridCountDownCallback rebuildIndexesCompleteCntr = new GridCountDownCallback(
cctx.cacheContexts().size(),
() -> log().info("Indexes rebuilding completed for all caches."),
1 //need at least 1 index rebuilded to print message about rebuilding completion
);
GridCompoundFuture compoundAllIdxsRebuilt = null;

if (qryProc.moduleEnabled()) {
for (final GridCacheContext cacheCtx : (Collection<GridCacheContext>)cctx.cacheContexts()) {
if (cacheCtx.startTopologyVersion().equals(fut.initialVersion())) {
final int cacheId = cacheCtx.cacheId();
Expand All @@ -1481,7 +1476,10 @@ private void prepareIndexRebuildFuture(int cacheId) {
log().info("Started indexes rebuilding for cache [name=" + cacheCtx.name()
+ ", grpName=" + cacheCtx.group().name() + ']');

assert usrFut != null : "Missing user future for cache: " + cacheCtx.name();
if (compoundAllIdxsRebuilt == null)
compoundAllIdxsRebuilt = new GridCompoundFuture();

compoundAllIdxsRebuilt.add(rebuildFut);

rebuildFut.listen(new CI1<IgniteInternalFuture>() {
@Override public void apply(IgniteInternalFuture fut) {
Expand All @@ -1503,8 +1501,6 @@ private void prepareIndexRebuildFuture(int cacheId) {
+ ", grpName=" + ccfg.getGroupName() + ']', err);
}
}

rebuildIndexesCompleteCntr.countDown(true);
}
});
}
Expand All @@ -1513,12 +1509,16 @@ private void prepareIndexRebuildFuture(int cacheId) {
idxRebuildFuts.remove(cacheId, usrFut);

usrFut.onDone();

rebuildIndexesCompleteCntr.countDown(false);
}
}
}
}

if (compoundAllIdxsRebuilt != null) {
compoundAllIdxsRebuilt.listen(a -> log().info("Indexes rebuilding completed for all caches."));

compoundAllIdxsRebuilt.markInitialized();
}
}
}

Expand Down

This file was deleted.

This file was deleted.

Expand Up @@ -21,7 +21,6 @@
import org.apache.ignite.internal.pagemem.impl.PageIdUtilsSelfTest;
import org.apache.ignite.internal.processors.cache.GridCacheUtilsSelfTest;
import org.apache.ignite.internal.util.GridArraysSelfTest;
import org.apache.ignite.internal.util.GridCountDownCallbackTest;
import org.apache.ignite.internal.util.IgniteDevOnlyLogTest;
import org.apache.ignite.internal.util.IgniteExceptionRegistrySelfTest;
import org.apache.ignite.internal.util.IgniteUtilsSelfTest;
Expand Down Expand Up @@ -125,9 +124,7 @@
PageIdUtilsSelfTest.class,

// control.sh
CommandHandlerParsingTest.class,

GridCountDownCallbackTest.class
CommandHandlerParsingTest.class
})
public class IgniteUtilSelfTestSuite {
}

0 comments on commit c836d4e

Please sign in to comment.