You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/02/02 08:04:35 UTC

[GitHub] [ozone] Xushaohong opened a new pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Xushaohong opened a new pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   ## What changes were proposed in this pull request?
   Problem:
   In PipelineManagerV2, the activate and deactivate pipeline methods don't have the lock that originally supposed to have based on the HA design. Thus the result is that ratis operation could be requested concurrently and may lead to reading the stale version of pipeline state.
   
   Solution:
   Add lock before calling the statemanager
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-4756
   
   ## How was this patch tested?
   The locked version is tested based on the tps upper bound test.
   The result shows that the number of ratis calls per second is declined rapidly.
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] GlenGeng commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-775131219


   @Xushaohong  Please rebase HDDS-2823. 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862






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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bshashikant commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
bshashikant commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-779642123


   Thanks @Xushaohong for the contribution.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] GlenGeng commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-774617385


   Please rebase HDDS-2823, then try out CI.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] amaliujia commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in SCMPipelineManagerV2

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-771081963


   LGTM


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] bshashikant merged pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
bshashikant merged pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] GlenGeng commented on a change in pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on a change in pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#discussion_r567581938



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerV2Impl.java
##########
@@ -411,8 +411,13 @@ public int minPipelineLimit(Pipeline pipeline) {
   @Override
   public void activatePipeline(PipelineID pipelineID)
       throws IOException {
-    stateManager.updatePipelineState(pipelineID.getProtobuf(),
-        HddsProtos.PipelineState.PIPELINE_OPEN);
+    lock.lock();
+    try{
+      stateManager.updatePipelineState(pipelineID.getProtobuf(),
+              HddsProtos.PipelineState.PIPELINE_OPEN);
+    }finally {

Review comment:
       indent.

##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerV2Impl.java
##########
@@ -411,8 +411,13 @@ public int minPipelineLimit(Pipeline pipeline) {
   @Override
   public void activatePipeline(PipelineID pipelineID)
       throws IOException {
-    stateManager.updatePipelineState(pipelineID.getProtobuf(),
-        HddsProtos.PipelineState.PIPELINE_OPEN);
+    lock.lock();
+    try{
+      stateManager.updatePipelineState(pipelineID.getProtobuf(),
+              HddsProtos.PipelineState.PIPELINE_OPEN);
+    }finally {

Review comment:
       indent. ` } finally {`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] Xushaohong closed pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
Xushaohong closed pull request #1862:
URL: https://github.com/apache/ozone/pull/1862


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] GlenGeng commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-770595440


   LGTM.
   
   Please trigger an all green CI.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] GlenGeng commented on pull request #1862: HDDS-4756. Add lock for activate/deactivate in PipelineManagerV2

Posted by GitBox <gi...@apache.org>.
GlenGeng commented on pull request #1862:
URL: https://github.com/apache/ozone/pull/1862#issuecomment-775700817


   @bshashikant  Please take a look !


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org