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 2020/11/24 05:46:10 UTC
[GitHub] [ozone] sadanand48 opened a new pull request #1615: HDDS-4451.Handle start & stop of Trash Emptier thread when node becom…
sadanand48 opened a new pull request #1615:
URL: https://github.com/apache/ozone/pull/1615
…es leader/follower
## What changes were proposed in this pull request?
Add handling for when to start/stop thread when OM switches from follower to leader or vice-versa.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-4451
## How was this patch tested?
Manually.
----------------------------------------------------------------
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] mukul1987 commented on a change in pull request #1615: HDDS-4451.Handle start & stop of Trash Emptier thread when node becom…
Posted by GitBox <gi...@apache.org>.
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:
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] mukul1987 commented on a change in pull request #1615: HDDS-4451.Handle start & stop of Trash Emptier thread when node becom…
Posted by GitBox <gi...@apache.org>.
mukul1987 commented on a change in pull request #1615:
URL: https://github.com/apache/ozone/pull/1615#discussion_r540798086
##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -1402,10 +1394,7 @@ public void stop() {
}
// TODO:Also stop this thread if an OM switches from leader to follower.
Review comment:
Lets remove this TODO's
----------------------------------------------------------------
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] mukul1987 merged pull request #1615: HDDS-4451.Handle start & stop of Trash Emptier thread when node becom…
Posted by GitBox <gi...@apache.org>.
mukul1987 merged pull request #1615:
URL: https://github.com/apache/ozone/pull/1615
----------------------------------------------------------------
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] mukul1987 commented on a change in pull request #1615: HDDS-4451.Handle start & stop of Trash Emptier thread when node becom…
Posted by GitBox <gi...@apache.org>.
mukul1987 commented on a change in pull request #1615:
URL: https://github.com/apache/ozone/pull/1615#discussion_r540691167
##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -107,6 +136,9 @@ public void run() {
end = ceiling(now, emptierInterval);
try { // sleep for interval
Thread.sleep(end - now);
+ if (!om.isLeader()){
+ return;
Review comment:
This should be continue here ?
----------------------------------------------------------------
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