File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
main/java/org/apache/ignite/internal/processors/cache
test/java/org/apache/ignite/internal/processors/cache Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -2224,12 +2224,12 @@ else if (type == EVT_CACHE_REBALANCE_STOPPED) {
22242224
22252225 for (ClusterNode node : affNodes ) {
22262226 if ((canRemap || discovery ().alive (node )) && !invalidNodes .contains (node )) {
2227- if (localNode ().dataCenterId () != null ) {
2227+ if (locMacs .equals (node .attribute (ATTR_MACS )))
2228+ return node ;
2229+ else if (localNode ().dataCenterId () != null ) {
22282230 if (node .dataCenterId ().equals (localNode ().dataCenterId ()))
22292231 return node ;
22302232 }
2231- else if (locMacs .equals (node .attribute (ATTR_MACS )))
2232- return node ;
22332233
22342234 if (r >= 0 || n0 == null )
22352235 n0 = node ;
Original file line number Diff line number Diff line change 1717
1818package org .apache .ignite .internal .processors .cache ;
1919
20+ import java .util .Collections ;
21+ import java .util .UUID ;
2022import java .util .concurrent .ThreadLocalRandom ;
2123import org .apache .ignite .IgniteCache ;
2224import org .apache .ignite .IgniteSystemProperties ;
2325import org .apache .ignite .configuration .CacheConfiguration ;
2426import org .apache .ignite .configuration .IgniteConfiguration ;
2527import org .apache .ignite .internal .IgniteEx ;
28+ import org .apache .ignite .internal .IgniteNodeAttributes ;
2629import org .apache .ignite .internal .TestRecordingCommunicationSpi ;
2730import org .apache .ignite .testframework .junits .common .GridCommonAbstractTest ;
2831import org .junit .Test ;
@@ -50,8 +53,14 @@ public class CacheMdcGetTest extends GridCommonAbstractTest {
5053
5154 /** {@inheritDoc} */
5255 @ Override protected IgniteConfiguration getConfiguration (String igniteInstanceName ) throws Exception {
53- return super .getConfiguration (igniteInstanceName )
56+ IgniteConfiguration cfg = super .getConfiguration (igniteInstanceName )
5457 .setCommunicationSpi (new TestRecordingCommunicationSpi ());
58+
59+ // Enforce different mac adresses to emulate distributed environment by default.
60+ cfg .setUserAttributes (Collections .singletonMap (
61+ IgniteNodeAttributes .ATTR_MACS_OVERRIDE , UUID .randomUUID ().toString ()));
62+
63+ return cfg ;
5564 }
5665
5766 /** */
You can’t perform that action at this time.
0 commit comments