You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by il...@apache.org on 2021/03/17 15:24:47 UTC
[ignite] branch master updated: IGNITE-14308 Convert exception to
warning in case of local deployment with unexpected node id.
This is an automated email from the ASF dual-hosted git repository.
ilyak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new c510805 IGNITE-14308 Convert exception to warning in case of local deployment with unexpected node id.
c510805 is described below
commit c51080583a505842262ab5a4541aeb7e4878966e
Author: Ilya Kasnacheev <il...@gmail.com>
AuthorDate: Fri Mar 5 18:06:16 2021 +0300
IGNITE-14308 Convert exception to warning in case of local deployment with unexpected node id.
---
.../cache/GridCacheDeploymentManager.java | 25 ++++++++++++++--------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index afd67b2..31c2b14 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -603,14 +603,15 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
if (locDep0 != null) {
// Will copy sequence number to bean.
dep = new GridDeploymentInfoBean(locDep0);
+
+ checkDeploymentIsCorrect(dep, deployable, false);
}
}
+ else
+ checkDeploymentIsCorrect(dep, deployable, true);
- if (dep != null) {
- checkDeploymentIsCorrect(dep, deployable);
-
+ if (dep != null)
deployable.prepare(dep);
- }
if (log.isDebugEnabled())
log.debug("Prepared grid cache deployable [dep=" + dep + ", deployable=" + deployable + ']');
@@ -622,16 +623,22 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
*
* @param deployment Deployment.
* @param deployable Deployable message.
+ * @param failIfNotCorrect Flag determining whether to throw exception or just warn.
* @throws IgnitePeerToPeerClassLoadingException If deployment is incorrect.
*/
- private void checkDeploymentIsCorrect(GridDeploymentInfoBean deployment, GridCacheDeployable deployable)
+ private void checkDeploymentIsCorrect(GridDeploymentInfoBean deployment, GridCacheDeployable deployable,
+ boolean failIfNotCorrect)
throws IgnitePeerToPeerClassLoadingException {
if (deployment.participants() == null
&& !cctx.localNode().id().equals(deployment.classLoaderId().globalId())) {
- throw new IgnitePeerToPeerClassLoadingException("Failed to use deployment to prepare deployable, " +
- "because local node id does not correspond with class loader id, and there are no more participants " +
- "[localNodeId=" + cctx.localNode().id() + ", deployment=" + deployment + ", deployable=" + deployable +
- ", locDep=" + locDep.get() + "]");
+ String msg = "Should not use deployment to prepare deployable, because local node id does not correspond " +
+ "with class loader id, and there are no more participants [locNodeId=" + cctx.localNode().id() +
+ ", deployment=" + deployment + ", deployable=" + deployable + ", locDep=" + locDep.get() + "]";
+
+ if (failIfNotCorrect)
+ throw new IgnitePeerToPeerClassLoadingException(msg);
+
+ log.warning(msg);
}
}