Closed drcrallen closed 8 years ago
The weird thing is the task instantly launched once the shutdown process started, this makes me wonder if there was some reason it was being blocked from the forking task runner's queue being full.
When the middle manager restarted, one task was reporting weird, and the number of tasks was greater than the configured capacity of the node:
2016-06-22T19:45:49,304 INFO [main] io.druid.indexing.overlord.ForkingTaskRunner - Restored 10 tasks.
2016-06-22T19:45:49,321 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8100}].
2016-06-22T19:45:49,322 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8101}].
2016-06-22T19:45:49,322 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8102}].
2016-06-22T19:45:49,322 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8103}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8104}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8105}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8106}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED2_2016-06-22T16:00:00.000Z_0_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8107}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1] location changed to [TaskLocation{host='REDACTED_HOST', port=8108}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0] location changed to [TaskLocation{host='null', port=-1}].
2016-06-22T19:45:49,323 INFO [main] io.druid.indexing.overlord.ForkingTaskRunner - Registered listener [WorkerTaskMonitor]
The task index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0
has a log retrievable through the overlord, but is failed in the console:
End of log from weird task:
2016-06-22T19:25:46,341 INFO [REDACTED-incremental-persist] io.druid.segment.ReferenceCountingSegment - Closing REDACTED_2016-06-22T18:00:00.000Z_2016-06-22T19:00:00.000Z_2016-06-22T18:15:02.029Z_48
2016-06-22T19:25:46,342 INFO [REDACTED-incremental-persist] io.druid.segment.ReferenceCountingSegment - Closing REDACTED_2016-06-22T18:00:00.000Z_2016-06-22T19:00:00.000Z_2016-06-22T18:15:02.029Z_48, numReferences: 0
2016-06-22T19:25:46,343 INFO [task-runner-0-priority-0] io.druid.indexing.common.task.RealtimeIndexTask - Gracefully stopping.
2016-06-22T19:25:46,343 INFO [task-runner-0-priority-0] io.druid.indexing.common.task.RealtimeIndexTask - Job done!
2016-06-22T19:25:46,343 INFO [task-runner-0-priority-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0] status changed to [SUCCESS].
2016-06-22T19:25:46,344 INFO [Thread-102] io.druid.indexing.overlord.ThreadPoolTaskRunner - Graceful shutdown of task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0] finished in 519ms.
2016-06-22T19:25:46,344 INFO [Thread-102] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0] status changed to [SUCCESS].
2016-06-22T19:25:46,344 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void io.druid.curator.discovery.ServerDiscoverySelector.stop() throws java.io.IOException] on object[io.druid.curator.discovery.ServerDiscoverySelector@3a8cea24].
2016-06-22T19:25:46,347 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void io.druid.curator.announcement.Announcer.stop()] on object[io.druid.curator.announcement.Announcer@5af5d76f].
2016-06-22T19:25:46,347 INFO [Thread-102] io.druid.curator.announcement.Announcer - unannouncing [/druid/compressed/segments/REDACTED_HOST:8102/REDACTED_HOST:8102_realtime__default_tier_2016-06-22T18:15:03.699Z_0b9848bf5398424589e0ca5a9b495a6a0]
2016-06-22T19:25:46,348 INFO [task-runner-0-priority-0] io.druid.indexing.worker.executor.ExecutorLifecycle - Task completed with status: {
"id" : "index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0",
"status" : "SUCCESS",
"duration" : 6038588
}
2016-06-22T19:25:46,355 INFO [main] io.druid.cli.CliPeon - Thread [Thread[Thread-102,5,main]] is non daemon.
2016-06-22T19:25:46,356 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void io.druid.curator.discovery.ServerDiscoverySelector.stop() throws java.io.IOException] on object[io.druid.curator.discovery.ServerDiscoverySelector@67770b37].
2016-06-22T19:25:46,356 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void com.metamx.http.client.NettyHttpClient.stop()] on object[com.metamx.http.client.NettyHttpClient@574059d5].
2016-06-22T19:25:46,376 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void com.metamx.metrics.MonitorScheduler.stop()] on object[com.metamx.metrics.MonitorScheduler@36776c32].
2016-06-22T19:25:46,382 INFO [Thread-102] io.druid.curator.CuratorModule - Stopping Curator
2016-06-22T19:25:46,383 INFO [Curator-Framework-0] org.apache.curator.framework.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
2016-06-22T19:25:46,387 INFO [Thread-102] org.apache.zookeeper.ZooKeeper - Session: 0xe5559cc045d3c6f closed
2016-06-22T19:25:46,387 INFO [main-EventThread] org.apache.zookeeper.ClientCnxn - EventThread shut down for session: 0xe5559cc045d3c6f
2016-06-22T19:25:46,388 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void com.metamx.emitter.service.ServiceEmitter.close() throws java.io.IOException] on object[com.metamx.emitter.service.ServiceEmitter@413bef78].
2016-06-22T19:25:46,391 INFO [Thread-102] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void io.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner.stop()] on object[io.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner@3f63a513].
The only way to get the middle manager responsive again was to delete the task directory for index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0
and restart the middle manager.
Then the middle manager reported
2016-06-22T19:48:13,250 WARN [main] io.druid.indexing.overlord.ForkingTaskRunner - Failed to restore task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0]. Trying to restore other tasks.
java.io.FileNotFoundException: /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0/task.json (No such file or directory)
at java.io.FileInputStream.open0(Native Method) ~[?:1.8.0_91]
at java.io.FileInputStream.open(FileInputStream.java:195) ~[?:1.8.0_91]
at java.io.FileInputStream.<init>(FileInputStream.java:138) ~[?:1.8.0_91]
at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:708) ~[druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2115) ~[druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.indexing.overlord.ForkingTaskRunner.restore(ForkingTaskRunner.java:154) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.indexing.worker.WorkerTaskMonitor.restoreRestorableTasks(WorkerTaskMonitor.java:169) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.indexing.worker.WorkerTaskMonitor.start(WorkerTaskMonitor.java:108) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91]
at com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler.start(Lifecycle.java:350) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at com.metamx.common.lifecycle.Lifecycle.start(Lifecycle.java:259) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.guice.LifecycleModule$2.start(LifecycleModule.java:155) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.cli.GuiceRunnable.initLifecycle(GuiceRunnable.java:91) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.cli.ServerRunnable.run(ServerRunnable.java:40) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
at io.druid.cli.Main.main(Main.java:105) [druid-selfcontained-0.9.1-rc3-mmx0.jar:0.9.1-rc3-mmx0]
2016-06-22T19:48:13,254 INFO [main] io.druid.indexing.overlord.ForkingTaskRunner - Restored 9 tasks.
And continued as expected.
It is unknown at this time if this is a regression or not.
I filed https://github.com/druid-io/druid/pull/3172 to better be able to tell what things are holding the worker threads.
I forgot to mention in the original comment that during the shutdown the truant task launched as per the middle manager logs:
2016-06-22T19:25:45,719 INFO [Thread-68] com.metamx.common.lifecycle.Lifecycle - Running shutdown hook
2016-06-22T19:25:45,723 INFO [Thread-68] org.eclipse.jetty.server.ServerConnector - Stopped ServerConnector@4aa11206{HTTP/1.1}{0.0.0.0:8080}
2016-06-22T19:25:45,725 INFO [Thread-68] org.eclipse.jetty.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@6d2a2560{/,null,UNAVAILABLE}
2016-06-22T19:25:45,730 INFO [Thread-68] com.metamx.common.lifecycle.Lifecycle$AnnotationBasedHandler - Invoking stop method[public void io.druid.indexing.worker.WorkerTaskMonitor.stop() throws java.lang.InterruptedException] on object[io.druid.indexing.worker.WorkerTaskMonitor@1dba4e06].
2016-06-22T19:25:45,731 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Unregistered listener [WorkerTaskMonitor]
2016-06-22T19:25:45,731 INFO [WorkerTaskMonitor] io.druid.indexing.worker.WorkerTaskMonitor - WorkerTaskMonitor interrupted, exiting.
2016-06-22T19:25:45,731 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0].
2016-06-22T19:25:45,732 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0].
2016-06-22T19:25:45,732 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0].
2016-06-22T19:25:45,732 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0].
2016-06-22T19:25:45,733 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0].
2016-06-22T19:25:45,733 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0].
2016-06-22T19:25:45,733 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED2_2016-06-22T16:00:00.000Z_0_0].
2016-06-22T19:25:45,734 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1].
2016-06-22T19:25:45,734 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Closing output stream to task[index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0].
2016-06-22T19:25:45,735 INFO [Thread-68] io.druid.indexing.overlord.ForkingTaskRunner - Waiting up to 300,000ms for shutdown.
2016-06-22T19:25:46,389 INFO [forking-task-runner-8] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0
2016-06-22T19:25:46,390 INFO [forking-task-runner-8] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0/log
2016-06-22T19:25:46,415 INFO [forking-task-runner-5] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0
2016-06-22T19:25:46,416 INFO [forking-task-runner-5] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0/log
2016-06-22T19:25:46,417 INFO [forking-task-runner-2] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0
2016-06-22T19:25:46,418 INFO [forking-task-runner-2] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0/log
2016-06-22T19:25:46,423 INFO [forking-task-runner-0] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0
2016-06-22T19:25:46,424 INFO [forking-task-runner-0] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0/log
2016-06-22T19:25:46,437 INFO [forking-task-runner-7] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0
2016-06-22T19:25:46,438 INFO [forking-task-runner-7] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0/log
2016-06-22T19:25:46,441 INFO [forking-task-runner-1] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1
2016-06-22T19:25:46,442 INFO [forking-task-runner-1] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1/log
2016-06-22T19:25:46,445 INFO [forking-task-runner-6] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0
2016-06-22T19:25:46,445 INFO [forking-task-runner-6] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0/log
2016-06-22T19:25:46,559 INFO [forking-task-runner-2] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_50_0] status changed to [FAILED].
2016-06-22T19:25:46,561 INFO [forking-task-runner-2] io.druid.indexing.overlord.ForkingTaskRunner - Running command: java -cp conf/:lib/druid-selfcontained-0.9.1-rc3-mmx0.jar: REDACTED io.druid.cli.Main internal peon /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0/task.json /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0/972865ff-d5bb-4f03-ba7f-57bff6e0d2ac/status.json --nodeType realtime
2016-06-22T19:25:46,562 INFO [forking-task-runner-2] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8103}].
2016-06-22T19:25:46,562 INFO [forking-task-runner-2] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0] status changed to [RUNNING].
2016-06-22T19:25:46,562 INFO [forking-task-runner-2] io.druid.indexing.overlord.ForkingTaskRunner - Logging task index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0 output to: /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_56_0/log
2016-06-22T19:25:46,595 INFO [forking-task-runner-5] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_55_0] status changed to [FAILED].
2016-06-22T19:25:46,611 INFO [forking-task-runner-7] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_53_0] status changed to [FAILED].
2016-06-22T19:25:46,619 INFO [forking-task-runner-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_51_0] status changed to [FAILED].
2016-06-22T19:25:46,625 INFO [forking-task-runner-1] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_46_1] status changed to [FAILED].
2016-06-22T19:25:46,638 INFO [forking-task-runner-8] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_54_0] status changed to [FAILED].
2016-06-22T19:25:46,670 INFO [forking-task-runner-3] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0
2016-06-22T19:25:46,670 INFO [forking-task-runner-3] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0/log to: prod/logs/v1/index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0/log
2016-06-22T19:25:46,710 INFO [forking-task-runner-6] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_52_0] status changed to [FAILED].
2016-06-22T19:25:46,784 INFO [forking-task-runner-3] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_2016-06-22T18:00:00.000Z_48_0] status changed to [FAILED].
2016-06-22T19:25:48,837 INFO [forking-task-runner-4] io.druid.indexing.overlord.ForkingTaskRunner - Process exited with status[2] for task: index_realtime_REDACTED2_2016-06-22T16:00:00.000Z_0_0
2016-06-22T19:25:48,838 INFO [forking-task-runner-4] io.druid.storage.s3.S3TaskLogs - Pushing task log /mnt/persistent/task/index_realtime_REDACTED2_2016-06-22T16:00:00.000Z_0_0/log to: prod/logs/v1/index_realtime_REDACTED2_2016-06-22T16:00:00.000Z_0_0/log
Task launches on middle manager in question as per overlord logs:
2016-06-22T15:55:02,164
2016-06-22T17:45:03,146
2016-06-22T17:45:03,176
2016-06-22T17:45:03,244
2016-06-22T17:45:03,277
2016-06-22T17:45:03,310
2016-06-22T17:45:03,342
2016-06-22T17:45:03,362
2016-06-22T17:45:03,404
2016-06-22T17:45:03,416 <--- _56_0
There weren't any overlord leadership changes or mm restarts in that time. And that's one more than the capacity for that node.
At 2016-06-22T17:45:00,077
the MM reported one task assigned. Then at 2016-06-22T17:50:00,080
it reported 10.
Might be related to https://github.com/druid-io/druid/pull/2521
Filtering overlord logs to just the worker of interest yields the following:
2016-06-22T17:45:03,146 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_46_1]
2016-06-22T17:45:03,150 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_46_1 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,160 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_46_1] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,168 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_46_1] on [TaskLocation{host='REDACTED_HOST', port=8100}]
2016-06-22T17:45:03,169 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_46_1] location changed to [TaskLocation{host='REDACTED_HOST', port=8100}].
2016-06-22T17:45:03,176 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_48_0]
2016-06-22T17:45:03,180 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_48_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,189 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_48_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,193 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_48_0] on [TaskLocation{host='REDACTED_HOST', port=8102}]
2016-06-22T17:45:03,193 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_48_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8102}].
2016-06-22T17:45:03,244 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_50_0]
2016-06-22T17:45:03,249 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_50_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,256 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_50_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,262 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_50_0] on [TaskLocation{host='REDACTED_HOST', port=8103}]
2016-06-22T17:45:03,262 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_50_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8103}].
2016-06-22T17:45:03,277 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_52_0]
2016-06-22T17:45:03,282 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_52_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,289 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_52_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,296 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_52_0] on [TaskLocation{host='REDACTED_HOST', port=8104}]
2016-06-22T17:45:03,296 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_52_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8104}].
2016-06-22T17:45:03,310 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_53_0]
2016-06-22T17:45:03,315 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_53_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,321 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_53_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,331 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_53_0] on [TaskLocation{host='REDACTED_HOST', port=8105}]
2016-06-22T17:45:03,331 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_53_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8105}].
2016-06-22T17:45:03,342 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_54_0]
2016-06-22T17:45:03,346 INFO [rtr-pending-tasks-runner-1] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_54_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,353 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_54_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,359 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_54_0] on [TaskLocation{host='REDACTED_HOST', port=8106}]
2016-06-22T17:45:03,359 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_54_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8106}].
2016-06-22T17:45:03,362 INFO [rtr-pending-tasks-runner-2] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_51_0]
2016-06-22T17:45:03,366 INFO [rtr-pending-tasks-runner-2] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_51_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,373 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_51_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,398 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_51_0] on [TaskLocation{host='REDACTED_HOST', port=8107}]
2016-06-22T17:45:03,398 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_51_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8107}].
2016-06-22T17:45:03,404 INFO [rtr-pending-tasks-runner-2] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_55_0]
2016-06-22T17:45:03,408 INFO [rtr-pending-tasks-runner-2] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_55_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,416 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_55_0] on [TaskLocation{host='null', port=-1}]
2016-06-22T17:45:03,416 INFO [rtr-pending-tasks-runner-0] io.druid.indexing.overlord.RemoteTaskRunner - Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_56_0]
2016-06-22T17:45:03,421 INFO [rtr-pending-tasks-runner-0] io.druid.indexing.overlord.RemoteTaskRunner - Task index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_56_0 switched from pending to running (on [REDACTED_HOST])
2016-06-22T17:45:03,426 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_55_0] on [TaskLocation{host='REDACTED_HOST', port=8108}]
2016-06-22T17:45:03,426 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.TaskRunnerUtils - Task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_55_0] location changed to [TaskLocation{host='REDACTED_HOST', port=8108}].
2016-06-22T17:45:03,428 INFO [Curator-PathChildrenCache-0] io.druid.indexing.overlord.RemoteTaskRunner - Worker[REDACTED_HOST] wrote RUNNING status for task [index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_56_0] on [TaskLocation{host='null', port=-1}]
It is worth noting that the node that went over capacity violated the normal logging flow somehow.
Coordinator asking Worker[REDACTED_HOST] to add task[index_realtime_REDACTED_DATASOURCE_2016-06-22T18:00:00.000Z_56_0]
happened BEFORE the log of 55_0
showing the new location, by a few ms.
I'm not sure if this is expected or not, but it looks like assignment to the worker is supposed to be blocked. Digging more
Also note the rtr pending task launcher was in different threads.
@gianm note that tranquility does NOT like the fact that a task is "RUNNING" but has null host and -1 port
worker select strategy is responsible for ensuring that it selects a worker which has available slot to run the task. WorkerSelectStrategy works on an immutable view of cluster passed to it by RTR. So it is possible that with multiple assignment threads, the select strategy will choose an incorrect worker.
One possible way to fix this can be to add a check in RTR announceTask() protected by statusLock for capacity and retrying.
I think I found it:
RTR has a guard against multiple things trying to launch on the same worker via workersWithUnacknowledgedTask.putIfAbsent(immutableZkWorker.get().getWorker().getHost(), task.getId()
. But this is enforced AFTER the check for space on the workers through strategy.findWorkerForTask
As such, it is possible for N tasks (where N is the number of launching threads) to all think that worker W has capacity, and for them ALL to pass the check if the exact wrong kind of race occurs. Which means that a worker can be over-subscribed up to N-1 tasks.
I'm setting druid.indexer.runner.pendingTasksRunnerNumThreads=1
for the overlord to ensure this does not occur.
@drcrallen shall we move this to 0.9.2 given that #3184 works around it?
oops, move to 0.9.2, I mean.
ah, thanks
General consensus seems to be to leave a complete fix for 0.9.2, re-assigning milestone
Given that this is the second regression introduced by https://github.com/druid-io/druid/pull/2521, would it make sense to have another review of that PR before we declare stable?
@drcrallen thanks for detailed investigation.
race described here should be fixable by #3205 , however likelihood of this race surfacing in practice seems very low and I'm wondering if there is something else that we are potentially missing.
we have been running #2521 cherry-picked to internal druid 0.8.2 version, will continue to monitor if we see this race happening there.
@himanshug it surfaced in practice while we were qualifying 0.9.1
@drcrallen I agree that you noticed worker running over capacity but I am just trying to think of other things that could cause the issue besides the race described.
@gianm can you confirm , that when announceTask(..) method exits , zkWorkers would be guaranteed to have updated view of that worker running the new task? I think it is , but just confirming.
fixed by #3205
RTR has a guard against multiple things trying to launch on the same worker via
workersWithUnacknowledgedTask.putIfAbsent(immutableZkWorker.get().getWorker().getHost(), task.getId()
. But this is enforced AFTER the check for space on the workers throughstrategy.findWorkerForTask
As such, it is possible for N tasks (where N is the number of launching threads set by
druid.indexer.runner.pendingTasksRunnerNumThreads
) to all think that worker W has capacity, and for them ALL to pass the check if the exact wrong kind of race occurs. Which means that a worker can be over-subscribed up to N-1 tasks.The middle manager logs before sending a SIGINT look like this, with the shutdown handler appearing as the last entry:
Before firing the shutdown handler, A thread dump was taken, and here are the threads (very booring repeated sections snipped for brevity):
((more in comments))