mukul1987 commented on a change in pull request #1615:
URL: https://github.com/apache/ozone/pull/1615#discussion_r529648270
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -98,7 +105,8 @@ public Runnable getEmptier() throws IOException {
@Override
public void run() {
- if (emptierInterval == 0) {
+ // if this is not the leader node,don't run the emptier
+ if (emptierInterval == 0 || !om.isLeader()) {
Review comment:
Also lets see if we can add a unit test for this change. Please check
with @bharatviswa504 on the test
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -98,7 +105,8 @@ public Runnable getEmptier() throws IOException {
@Override
public void run() {
- if (emptierInterval == 0) {
+ // if this is not the leader node,don't run the emptier
+ if (emptierInterval == 0 || !om.isLeader()) {
Review comment:
I think this should happen after the thread.sleep at line 117. As for
most of the cases, when an OM restart the trash emptier it should check this
status and skip doing any Trash processing.
----------------------------------------------------------------
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]