|
29 | 29 | import org.apache.ignite.IgniteCache; |
30 | 30 | import org.apache.ignite.cache.CacheAtomicityMode; |
31 | 31 | import org.apache.ignite.cache.CacheMode; |
32 | | -import org.apache.ignite.cache.CachePeekMode; |
33 | 32 | import org.apache.ignite.cache.CacheWriteSynchronizationMode; |
34 | 33 | import org.apache.ignite.cache.QueryEntity; |
35 | | -import org.apache.ignite.cache.affinity.Affinity; |
36 | 34 | import org.apache.ignite.cache.query.SqlFieldsQuery; |
37 | 35 | import org.apache.ignite.cache.store.CacheStoreAdapter; |
38 | 36 | import org.apache.ignite.cluster.ClusterState; |
|
67 | 65 | import static org.apache.ignite.events.EventType.EVT_NODE_LEFT; |
68 | 66 | import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK; |
69 | 67 | import static org.apache.ignite.testframework.GridTestUtils.cartesianProduct; |
| 68 | +import static org.apache.ignite.testframework.GridTestUtils.waitForCondition; |
70 | 69 | import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC; |
71 | 70 | import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; |
72 | 71 | import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED; |
@@ -240,47 +239,10 @@ public void testTxCoordinatorLeftClusterWithEnabledReadWriteThrough() throws Exc |
240 | 239 |
|
241 | 240 | awaitPartitionMapExchange(); |
242 | 241 |
|
243 | | - sqlVisibilityCheck(List.of(nodeCoord, nodeBackup), primaryKey, secondVal); |
244 | | - |
245 | | - int cacheSize = cache.size(); |
246 | | - assertEquals(1, cacheSize); |
247 | | - |
248 | | - int locSize = -1; |
249 | | - Object peeked = null; |
250 | | - |
251 | | - for (Ignite g : G.allGrids()) { |
252 | | - final Affinity<Integer> aff = affinity(g.cache(DEFAULT_CACHE_NAME)); |
253 | | - |
254 | | - boolean primary = aff.isPrimary(g.cluster().localNode(), primaryKey); |
255 | | - |
256 | | - Object peekedCurr; |
257 | | - |
258 | | - if (primary) |
259 | | - peekedCurr = g.cache(DEFAULT_CACHE_NAME).localPeek(primaryKey, CachePeekMode.PRIMARY); |
260 | | - else |
261 | | - peekedCurr = g.cache(DEFAULT_CACHE_NAME).localPeek(primaryKey, CachePeekMode.BACKUP); |
262 | | - |
263 | | - if (peeked == null) |
264 | | - peeked = peekedCurr; |
265 | | - else { |
266 | | - assertEquals(peeked, peekedCurr); |
267 | | - assertNotNull(peeked); |
268 | | - } |
269 | | - |
270 | | - int locSizeCurr; |
271 | | - |
272 | | - if (primary) |
273 | | - locSizeCurr = g.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.PRIMARY); |
274 | | - else |
275 | | - locSizeCurr = g.cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.BACKUP); |
276 | | - |
277 | | - if (locSize == -1) |
278 | | - locSize = locSizeCurr; |
279 | | - else { |
280 | | - assertEquals(locSize, locSizeCurr); |
281 | | - } |
282 | | - |
283 | | - assertNotNull("grid instance: " + g.name(), g.cache(DEFAULT_CACHE_NAME).get(primaryKey)); |
| 242 | + for (int nodeIdx : List.of(0, 2)) { |
| 243 | + IgniteEx g = grid(nodeIdx); |
| 244 | + IgniteCache<Object, Object> cacheInner = g.cache(DEFAULT_CACHE_NAME); |
| 245 | + waitForCondition(() -> secondVal == (int)cacheInner.get(primaryKey), 1_000); |
284 | 246 | } |
285 | 247 |
|
286 | 248 | assertEquals(EXIT_CODE_OK, execute("--port", connectorPort(grid(2)), "--cache", "idle_verify")); |
|
0 commit comments