mukul1987 commented on a change in pull request #1999:
URL: https://github.com/apache/ozone/pull/1999#discussion_r589227956
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java
##########
@@ -103,6 +104,27 @@ public static void initialize(String clusterId, String
scmId,
server.close();
}
+ public static void reinitialize(String clusterId, String scmId,
+ SCMNodeDetails details, OzoneConfiguration conf) throws IOException {
+ RaftServer server = newRaftServer(scmId, conf).build();
+ RaftGroup group = null;
+ Iterator<RaftGroup> iter = server.getGroups().iterator();
+ if (iter.hasNext()) {
+ group = iter.next();
+ }
+ // close the server instance so that pending locks on raft storage
directory
+ // gets released if any.
+ server.close();
Review comment:
Lets wrap the earlier code in try and do the server close in finally
block ?
----------------------------------------------------------------
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]