vldpyatkov commented on code in PR #11041:
URL: https://github.com/apache/ignite/pull/11041#discussion_r1665755332


##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -322,13 +322,33 @@ else if (log.isDebugEnabled())
         while (true) {
             List<SharedDeployment> depsToCheck = null;
 
-            SharedDeployment dep = null;
+            SharedDeployment dep;
 
             synchronized (mux) {
                 // Check obsolete request.
                 if (isDeadClassLoader(meta))
                     return null;
 
+                Collection<GridDeployment> created = getDeployments();

Review Comment:
   It should be in the If closure bellow.



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -322,13 +322,33 @@ else if (log.isDebugEnabled())
         while (true) {
             List<SharedDeployment> depsToCheck = null;
 
-            SharedDeployment dep = null;
+            SharedDeployment dep;
 
             synchronized (mux) {
                 // Check obsolete request.
                 if (isDeadClassLoader(meta))
                     return null;
 
+                Collection<GridDeployment> created = getDeployments();
+
+                boolean skipSearchDeployment = false;
+
+                // Check already exist deployment.
+                if (meta.deploymentMode() == SHARED) {
+                    for (GridDeployment dep0 : created) {
+                        // hot redeploy from same node
+                        if 
(dep0.participants().containsKey(meta.senderNodeId()) || dep0.undeployed())
+                            continue;
+
+                        IgniteBiTuple<Class<?>, Throwable> cls = 
dep0.deployedClass(meta.className(), meta.alias());
+
+                        if (cls.getKey() != null && cls.getValue() == null) {
+                            addParticipant((SharedDeployment)dep0, meta);

Review Comment:
   Here you move all partisipants for a class meta to the deploymnt, but bellow 
we might update the partisipant list in the class meta.
   May we try to update the partisipant list at first or don't do the update 
because the new list won't use?



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -376,7 +396,10 @@ else if (ctx.discovery().node(meta.senderNodeId()) == 
null) {
                     return null;
                 }
 
-                dep = (SharedDeployment)searchDeploymentCache(meta);
+                if (!skipSearchDeployment)
+                    dep = (SharedDeployment)searchDeploymentCache(meta);
+                else
+                    dep = null;

Review Comment:
   We can assignt the variable as null at definition.



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -322,13 +322,33 @@ else if (log.isDebugEnabled())
         while (true) {
             List<SharedDeployment> depsToCheck = null;
 
-            SharedDeployment dep = null;
+            SharedDeployment dep;
 
             synchronized (mux) {
                 // Check obsolete request.
                 if (isDeadClassLoader(meta))
                     return null;
 
+                Collection<GridDeployment> created = getDeployments();
+
+                boolean skipSearchDeployment = false;
+
+                // Check already exist deployment.
+                if (meta.deploymentMode() == SHARED) {
+                    for (GridDeployment dep0 : created) {
+                        // hot redeploy from same node
+                        if 
(dep0.participants().containsKey(meta.senderNodeId()) || dep0.undeployed())
+                            continue;
+
+                        IgniteBiTuple<Class<?>, Throwable> cls = 
dep0.deployedClass(meta.className(), meta.alias());
+
+                        if (cls.getKey() != null && cls.getValue() == null) {
+                            addParticipant((SharedDeployment)dep0, meta);
+                            skipSearchDeployment = true;
+                        }

Review Comment:
   Also, I think we can assigned it into dep variable and brake the root while 
loop.



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -322,13 +322,33 @@ else if (log.isDebugEnabled())
         while (true) {
             List<SharedDeployment> depsToCheck = null;
 
-            SharedDeployment dep = null;
+            SharedDeployment dep;
 
             synchronized (mux) {
                 // Check obsolete request.
                 if (isDeadClassLoader(meta))
                     return null;
 
+                Collection<GridDeployment> created = getDeployments();
+
+                boolean skipSearchDeployment = false;
+
+                // Check already exist deployment.
+                if (meta.deploymentMode() == SHARED) {
+                    for (GridDeployment dep0 : created) {
+                        // hot redeploy from same node
+                        if 
(dep0.participants().containsKey(meta.senderNodeId()) || dep0.undeployed())

Review Comment:
   Why are we skipping participan deployment?



##########
modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentPerVersionStore.java:
##########
@@ -322,13 +322,33 @@ else if (log.isDebugEnabled())
         while (true) {
             List<SharedDeployment> depsToCheck = null;
 
-            SharedDeployment dep = null;
+            SharedDeployment dep;
 
             synchronized (mux) {
                 // Check obsolete request.
                 if (isDeadClassLoader(meta))
                     return null;
 
+                Collection<GridDeployment> created = getDeployments();
+
+                boolean skipSearchDeployment = false;
+
+                // Check already exist deployment.
+                if (meta.deploymentMode() == SHARED) {
+                    for (GridDeployment dep0 : created) {
+                        // hot redeploy from same node
+                        if 
(dep0.participants().containsKey(meta.senderNodeId()) || dep0.undeployed())
+                            continue;
+
+                        IgniteBiTuple<Class<?>, Throwable> cls = 
dep0.deployedClass(meta.className(), meta.alias());
+
+                        if (cls.getKey() != null && cls.getValue() == null) {
+                            addParticipant((SharedDeployment)dep0, meta);
+                            skipSearchDeployment = true;
+                        }

Review Comment:
   Why don't bracke the loop when you find the deployment?



-- 
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]

Reply via email to