-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[BUG] Reduce TaskBatcher excessive logging in DEBUG mode #12249
Comments
We should look at 2 things:
|
Looking into it |
Tasksummary string is being computed and passed to runTasks in Masterservice OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 284 in a0b5198
Usage: Logging - OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 287 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 291 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 295 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 304 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 310 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 314 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 316 in a0b5198
OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 328 in a0b5198
Passed as source parameter in ClusterChangedEvent object - OpenSearch/server/src/main/java/org/opensearch/cluster/service/MasterService.java Line 320 in a0b5198
Next steps - Need to understand if changing summary value passed in ClusterChangedEvent will have any effect. |
Looks like change in the summary value in ClusterChangedEvent should not have an impact on the flow. For now, i am working on introducing a short summary which will contain the task batching key instead of computing and logging full tasks details. |
Describe the bug
OpenSearch/server/src/main/java/org/opensearch/cluster/service/TaskBatcher.java
Lines 197 to 201 in a0b5198
While executing a pending task, we first try to log the task summary. If the pending task batchingKey has 200K tasks in the linked list, we'll end up collecting task summary of all those tasks. This takes 10 minutes which blocks the overall execution of all the tasks. This summary is being used only for logging purpose in debug setting only.
Ideally we should not log excessive even in debug mode as calculating log string is taking minutes.
Related component
Cluster Manager
To Reproduce
Expected behavior
Ideally we should not log the same thing if content is same just the shardId is different. We should short circuit and log a smaller sized string to avid this delay.
Additional Details
Hot/threads
The text was updated successfully, but these errors were encountered: