You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2023/06/26 15:59:45 UTC

[GitHub] [kafka] jsancio opened a new pull request, #13917: MINOR; Failed move should be logged at WARN

jsancio opened a new pull request, #13917:
URL: https://github.com/apache/kafka/pull/13917

   When Kafka fails to perform file move the error is getting swallowed. Kafka should log these cases at least at WARN level.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] kirktrue commented on pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "kirktrue (via GitHub)" <gi...@apache.org>.
kirktrue commented on PR #13917:
URL: https://github.com/apache/kafka/pull/13917#issuecomment-1609649429

   @jsancio Another difference is that now the `outer` exception's stack trace will be shown via `WARN` instead of just the exception's message via `DEBUG`. I assume that's intentional, but just wanted to call it out. Thanks!


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jsancio commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242449562


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -978,9 +978,9 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
             Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);
         } catch (IOException outer) {
             try {
+                log.warn("Failed atomic move of {} to {} retring with a non-atomic move", source, target, outer);
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
-                        outer.getMessage());
+                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed", source, target);

Review Comment:
   Yeah. I think so. I care more about the atomic move failing and less about the non-atomic move succeeding.



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jsancio commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242429861


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -979,7 +979,7 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
         } catch (IOException outer) {
             try {
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
+                log.warn("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,

Review Comment:
   Hmm. Log levels are hard to argue. To me, it is really bad if a `move` fails and Kafka falls back to `copy`.
   
   There is a lot of code like the `Snaphsot.freeze` that assume `move` semantic for correctness.



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jsancio merged pull request #13917: MINOR; Failed move should be logged at WARN

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


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] rondagostino commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "rondagostino (via GitHub)" <gi...@apache.org>.
rondagostino commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242428311


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -979,7 +979,7 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
         } catch (IOException outer) {
             try {
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
+                log.warn("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,

Review Comment:
   Any maybe we should log something above the retry saying we are going to retry?



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] rondagostino commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "rondagostino (via GitHub)" <gi...@apache.org>.
rondagostino commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242444579


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -978,9 +978,9 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
             Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);
         } catch (IOException outer) {
             try {
+                log.warn("Failed atomic move of {} to {} retring with a non-atomic move", source, target, outer);
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
-                        outer.getMessage());
+                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed", source, target);

Review Comment:
   Remain DEBUG?



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jsancio commented on pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on PR #13917:
URL: https://github.com/apache/kafka/pull/13917#issuecomment-1612214700

   > @jsancio Another difference is that now the `outer` exception's stack trace will be shown via `WARN` instead of just the exception's message via `DEBUG`. I assume that's intentional, but just wanted to call it out. Thanks!
   
   Yes @kirktrue, that was intentional. I would like to see the thread stack when the atomic move fails.


-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] rondagostino commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "rondagostino (via GitHub)" <gi...@apache.org>.
rondagostino commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242424176


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -979,7 +979,7 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
         } catch (IOException outer) {
             try {
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
+                log.warn("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,

Review Comment:
   Is it really a WARN?  Maybe INFO is more appropriate?



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] rondagostino commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "rondagostino (via GitHub)" <gi...@apache.org>.
rondagostino commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242445724


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -978,9 +978,9 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
             Files.move(source, target, StandardCopyOption.ATOMIC_MOVE);
         } catch (IOException outer) {
             try {
+                log.warn("Failed atomic move of {} to {} retring with a non-atomic move", source, target, outer);
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
-                        outer.getMessage());
+                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed", source, target);

Review Comment:
   Maybe it is okay now that we are logging the initial WARn?



-- 
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: jira-unsubscribe@kafka.apache.org

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


[GitHub] [kafka] jsancio commented on a diff in pull request #13917: MINOR; Failed move should be logged at WARN

Posted by "jsancio (via GitHub)" <gi...@apache.org>.
jsancio commented on code in PR #13917:
URL: https://github.com/apache/kafka/pull/13917#discussion_r1242443198


##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -979,7 +979,7 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need
         } catch (IOException outer) {
             try {
                 Files.move(source, target, StandardCopyOption.REPLACE_EXISTING);
-                log.debug("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,
+                log.warn("Non-atomic move of {} to {} succeeded after atomic move failed due to {}", source, target,

Review Comment:
   I agree. I added an WARN log message after the atomic move failed and before the non-atomic move.



-- 
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: jira-unsubscribe@kafka.apache.org

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