timmylicheng commented on a change in pull request #1191:
URL: https://github.com/apache/hadoop-ozone/pull/1191#discussion_r454199946



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerV2Impl.java
##########
@@ -327,6 +349,9 @@ public void openPipeline(PipelineID pipelineId) throws 
IOException {
    * @throws IOException
    */
   protected void removePipeline(Pipeline pipeline) throws IOException {
+    if (!scmhaManager.isLeader()) {

Review comment:
       If we want to refactor the code, I would prefer annotation just like 
@Replicate in which we would create something like CheckLeaderInvocationHandler 
extends InvocationHandler and do isLeader check there.
   It would be convenient in interface. However, We also use isLeader check in 
some local methods instead of override methods. Let's keep it this fashion for 
now and we see if we can polish this.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to