oleg-vlsk commented on code in PR #11317:
URL: https://github.com/apache/ignite/pull/11317#discussion_r1622414794
##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java:
##########
@@ -1499,6 +1502,79 @@ protected GridCloseableIterator scanQueryLocal(final
GridCacheQueryAdapter qry,
}
}
+ /**
+ * Process local index query.
+ *
+ * @param qry Query.
+ * @return GridCloseableIterator.
+ */
+ @SuppressWarnings({"unchecked"})
+ public GridCloseableIterator indexQueryLocal(final GridCacheQueryAdapter
qry) throws IgniteCheckedException {
+ if (!enterBusy())
+ throw new IllegalStateException("Failed to process query request
(grid is stopping).");
+
+ try {
+ assert qry.type() == INDEX : "Wrong processing of query: " +
qry.type();
+
+ cctx.checkSecurity(SecurityPermission.CACHE_READ);
+
+ GridDhtCacheAdapter<?, ?> cacheAdapter = cctx.isNear() ?
cctx.near().dht() : cctx.dht();
+
+ Set<Integer> lostParts = cacheAdapter.topology().lostPartitions();
+
+ Integer part = qry.partition();
+
+ if (!lostParts.isEmpty()) {
+ if (part == null || lostParts.contains(part)) {
+ throw new CacheException(new
CacheInvalidStateException("Failed to execute query because cache partition " +
+ "has been lost [cacheName=" + cctx.name() +
+ ", part=" + (part == null ?
lostParts.iterator().next() : part) + ']'));
+ }
+ }
+
+ if (qry.nodes().isEmpty())
Review Comment:
IndexQueryLocalTest#testClientNodeReplicatedCache (running a local index
query on a client node) will fail if we don't do this check and throw a certain
exception after it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]