You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2023/05/09 18:32:44 UTC

[GitHub] [druid] kfaraz opened a new pull request, #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with coordinator

kfaraz opened a new pull request, #14235:
URL: https://github.com/apache/druid/pull/14235

   ### Changes
   
   - Replace `OverlordHelper` with `OverlordDuty`
     - Each duty has a `run()` method and defines a `Schedule` with an initial delay and period.
     - 
   - Add utility class `Configs`
   - Update log and error messages
   - Other minor style improvements
   
   <hr>
   
   This PR has:
   
   - [ ] been self-reviewed.
      - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] a release note entry in the PR description.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
   - [ ] added integration tests.
   - [ ] been tested in a test Druid cluster.
   


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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] LakshSingla commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1192051989


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   Same comment for the other duties/helpers which are wrapping the entire duty in a try..catch 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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1192117299


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   Edit: The implementation of both the existing duties actually throw unchecked IOException, and it is best to just handle them in the respective duties rather than adding `IOException` to the signature of `OverlordDuty.run()`. Alternatively, we could just add a plain `Exception` to the method signature.



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1192127155


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   > we could just add a plain Exception to the method signature.
   
   Went ahead with this. Thanks for the suggestion!



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz merged pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz merged PR #14235:
URL: https://github.com/apache/druid/pull/14235


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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1192091328


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   Thanks for pointing this out! You are right, neither of the existing duty/helpers are doing anything special with the exception, just logging it or wrapping it up and rethrowing it. I will get rid of these.



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] LakshSingla commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1190676019


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   Is this outer level try...catch required. In the OverlordDutyExecutor, we wrap the run of the duties in their own try...catch as well. The duty itself shouldn't worry about throwing the exceptions and it should be handled by the callers.



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with coordinator

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #14235:
URL: https://github.com/apache/druid/pull/14235#issuecomment-1540819724

   Code coverage is failing, will add more tests along with any other changes from code review.
   


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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on a diff in pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #14235:
URL: https://github.com/apache/druid/pull/14235#discussion_r1192117299


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/indexing/DurableStorageCleaner.java:
##########
@@ -75,66 +72,58 @@ public boolean isEnabled()
   }
 
   @Override
-  public void schedule(ScheduledExecutorService exec)
+  public void run()
   {
-    LOG.info("Starting the DurableStorageCleaner with the config [%s]", config);
+    try {

Review Comment:
   Edit: The implementation of both the existing duties actually throw unchecked IOException, and it is best to just handle them in the respective duties rather than adding `IOException` to the signature of `OverlordDuty.run()`.



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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] kfaraz commented on pull request #14235: Refactor: Add OverlordDuty to replace OverlordHelper and align with CoordinatorDuty

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #14235:
URL: https://github.com/apache/druid/pull/14235#issuecomment-1545429502

   Thanks for the review, @LakshSingla !


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

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org