Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File failed to get deleted #228

Closed
showuon opened this issue Sep 10, 2024 · 3 comments · Fixed by #230
Closed

File failed to get deleted #228

showuon opened this issue Sep 10, 2024 · 3 comments · Fixed by #230

Comments

@showuon
Copy link

showuon commented Sep 10, 2024

See the errors while running perf test in kroxylicious, and then files stayed in file system, which caused disk full in the end.
This is tested in quay.io/ogunalp/kafka-native:latest-kafka-3.8.0 image.

2024-09-10 03:40:14,138 INFO  [org.apa.kaf.sto.int.log.LogSegment] (kafka-scheduler-6) Deleted log /work/./target/log-dir/perf-test-18997-0.7109edb31fa540cab275cf9089bd02c3-delete/00000000000000000000.log.deleted.
2024-09-10 03:40:14,138 INFO  [org.apa.kaf.sto.int.log.LogSegment] (kafka-scheduler-6) Deleted offset index /work/./target/log-dir/perf-test-18997-0.7109edb31fa540cab275cf9089bd02c3-delete/00000000000000000000.index.deleted.
2024-09-10 03:40:14,139 INFO  [org.apa.kaf.sto.int.log.LogSegment] (kafka-scheduler-6) Deleted time index /work/./target/log-dir/perf-test-18997-0.7109edb31fa540cab275cf9089bd02c3-delete/00000000000000000000.timeindex.deleted.
2024-09-10 03:40:14,139 ERROR [kaf.log.LogManager] (kafka-scheduler-6) Exception in kafka-delete-logs thread.: java.lang.NullPointerException
	at org.apache.kafka.storage.internals.log.LogSegment.deleteTypeIfExists(LogSegment.java:818)
	at org.apache.kafka.storage.internals.log.LogSegment.lambda$deleteIfExists$13(LogSegment.java:794)
	at org.apache.kafka.common.utils.Utils.tryAll(Utils.java:1168)
	at org.apache.kafka.storage.internals.log.LogSegment.deleteIfExists(LogSegment.java:790)
	at kafka.log.LocalLog$.$anonfun$deleteSegmentFiles$5(LocalLog.scala:927)
	at kafka.log.LocalLog$.$anonfun$deleteSegmentFiles$5$adapted(LocalLog.scala:926)
	at scala.collection.immutable.List.foreach(List.scala:334)
	at kafka.log.LocalLog$.$anonfun$deleteSegmentFiles$4(LocalLog.scala:926)
	at kafka.log.LocalLog$.deleteSegments$1(LocalLog.scala:716)
	at kafka.log.LocalLog$.deleteSegmentFiles(LocalLog.scala:935)
	at kafka.log.LocalLog.removeAndDeleteSegments(LocalLog.scala:289)
	at kafka.log.LocalLog.$anonfun$deleteAllSegments$2(LocalLog.scala:254)
	at kafka.log.LocalLog.deleteAllSegments(LocalLog.scala:716)
	at kafka.log.UnifiedLog.$anonfun$delete$2(UnifiedLog.scala:1743)
	at kafka.log.UnifiedLog.delete(UnifiedLog.scala:1922)
	at kafka.log.LogManager.deleteLogs(LogManager.scala:1159)
	at kafka.log.LogManager.$anonfun$deleteLogs$6(LogManager.scala:1173)
	at org.apache.kafka.server.util.KafkaScheduler.lambda$schedule$1(KafkaScheduler.java:150)
	at java.base@17.0.12/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base@17.0.12/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base@17.0.12/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	at java.base@17.0.12/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base@17.0.12/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base@17.0.12/java.lang.Thread.run(Thread.java:840)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:885)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:860)

Detail can be found here: kroxylicious/kroxylicious#1505

@k-wall
Copy link
Collaborator

k-wall commented Sep 10, 2024

I think I see the issue.

public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {

I think that code is overwriting the class's initialisation. Its intent is to remove the static block which does the metrics stuff but leave the other processing intact.

It is failing to PUTSTATIC for the static field introduced KAFKA-16424:. So the upshot is, that field is NPE

I think that explains the NPE.

Am I along the right lines @ozangunalp?

@ozangunalp
Copy link
Owner

Absolutely. Maybe we can get rid of those substitutions.

@k-wall
Copy link
Collaborator

k-wall commented Sep 10, 2024

I don't have any skills in ASM, so I wouldn't really know where to start with an alternative approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants