I'm trying to figure out if the _update_by_query elasticsearch endpoint reindexes entire documents. I ran a batch process that generated and ran thousands of update_by_query statements. My CPU escalated after some time so I stopped running them. That was about a week ago, and my CPU is still abnormally high.
When I check the nodes in my cluster, one of them has unusually high processing percentage. I checked the hot threads against that node and it appears to still be processing update tasks. I stopped running the updates over a week ago. How could this node still be processing updates? My thinking was that it's reindexing documents that were affected by the updates.
The tasks API should tell you if you are still running the _update_by_query. IIRC one of the funny things about _update_by_query is that it'll perform a noop update of all documents if you give it an empty body. This might be what is going on here.
@nik9000 The hot_threads aren't particularly helpful to me, not really sure what to take away from it. Here's what it's reading for the heavy CPU node. Nothing really stands out to me. The response also constantly changes.
"::: {C_i25yS}{C_i25yS5SWSdrv3NPEoHEA}{IlzCv7ROQSaMm6IGV_Z88A}{x.x.x.x}{x.x.x.x:9300}{zone=us-west-2b}\n Hot threads at 2019-01-31T20:38:49.441Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:\n \n 68.3% (341.5ms out of 500ms) cpu usage by thread 'elasticsearch[C_i25yS][clusterApplierService#updateTask][T#1]'\n 2/10 snapshots sharing following 13 elements\n org.elasticsearch.indices.store.IndicesStore$ShardActiveResponseHandler.lambda$allNodesResponded$2(IndicesStore.java:289)\n org.elasticsearch.indices.store.IndicesStore$ShardActiveResponseHandler$$Lambda$1704/1699952741.accept(Unknown Source)\n org.elasticsearch.cluster.service.ClusterApplierService.lambda$runOnApplierThread$0(ClusterApplierService.java:307)\n org.elasticsearch.cluster.service.ClusterApplierService$$Lambda$1706/1089848983.apply(Unknown Source)\n org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.apply(ClusterApplierService.java:156)\n org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:400)\n org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:161)\n org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:573)\n org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:244)\n org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:207)\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n java.lang.Thread.run(Thread.java:748)\n 8/10 snapshots sharing following 2 elements\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n java.lang.Thread.run(Thread.java:748)\n\n"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.