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

[GitHub] [druid] adarshsanjeev opened a new pull request, #14350: Add logs for deleting files using storage connector

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

   A minor PR to add more logging for deleting files with StorageConnector. This would be useful for debugging issues related to these files (or their absence). Deleting files should not be too frequent generally to spam the logs.
   
   <hr>
   
   <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
   
   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] adarshsanjeev commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:
##########
@@ -329,11 +335,14 @@ private void deleteKeys(List<DeleteObjectsRequest.KeyVersion> versions) throws I
   public void deleteRecursively(String dirName) throws IOException
   {
     try {
+      final String fullPath = objectPath(dirName);
+      log.debug("Deleting directory at bucket: %s, path: %s", config.getBucket(), fullPath);
+

Review Comment:
   Done



-- 
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] adarshsanjeev commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:
##########
@@ -280,8 +280,11 @@ public OutputStream write(String path) throws IOException
   public void deleteFile(String path) throws IOException
   {
     try {
+      final String fullPath = objectPath(path);
+      log.debug("Deleting file at bucket: %s, path: %s", config.getBucket(), fullPath);
+
       S3Utils.retryS3Operation(() -> {
-        s3Client.deleteObject(config.getBucket(), objectPath(path));
+        s3Client.deleteObject(config.getBucket(), fullPath);

Review Comment:
   Is there a reason we don't use deleteObjects for deleting a single file as well? I wonder if refactoring it to also pass through S3Utils like deleteFiles would be cleaner.



-- 
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] cryptoe merged pull request #14350: Add logs for deleting files using storage connector

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


-- 
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] cryptoe commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java:
##########
@@ -260,6 +261,8 @@ public static void deleteObjectsInPath(
   )
       throws Exception
   {
+    log.debug("Deleting directory at bucket: %s, path: %s", bucket, prefix);

Review Comment:
   can you use `[%s]` that way we would not have cleaner log messages.  



-- 
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] cryptoe commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:
##########
@@ -280,8 +280,11 @@ public OutputStream write(String path) throws IOException
   public void deleteFile(String path) throws IOException
   {
     try {
+      final String fullPath = objectPath(path);
+      log.debug("Deleting file at bucket: %s, path: %s", config.getBucket(), fullPath);
+
       S3Utils.retryS3Operation(() -> {
-        s3Client.deleteObject(config.getBucket(), objectPath(path));
+        s3Client.deleteObject(config.getBucket(), fullPath);

Review Comment:
   Since its a single file, I think its okay to have s3Client.deleteObject() for it. 



-- 
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] cryptoe commented on pull request #14350: Add logs for deleting files using storage connector

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

   Thanks @adarshsanjeev for the contribution!!


-- 
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] adarshsanjeev commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java:
##########
@@ -260,6 +261,8 @@ public static void deleteObjectsInPath(
   )
       throws Exception
   {
+    log.debug("Deleting directory at bucket: %s, path: %s", bucket, prefix);

Review Comment:
   Done



-- 
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] cryptoe commented on a diff in pull request #14350: Add logs for deleting files using storage connector

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


##########
extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/output/S3StorageConnector.java:
##########
@@ -329,11 +335,14 @@ private void deleteKeys(List<DeleteObjectsRequest.KeyVersion> versions) throws I
   public void deleteRecursively(String dirName) throws IOException
   {
     try {
+      final String fullPath = objectPath(dirName);
+      log.debug("Deleting directory at bucket: %s, path: %s", config.getBucket(), fullPath);
+

Review Comment:
   Please push these logging line to the s3Utils class so that other callers also benefit from it. 



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