Skip to content

Commit

Permalink
[SecuritySolution] Improve asset criticality migration task (elastic#…
Browse files Browse the repository at this point in the history
…194791)

## Summary

After testing the task for 1_000_000 criticalities, I noticed some
request timeouts in the logs.
The task finished successfully because it retried after the timeouts.
But let's prevent it.

So, I updated the `requestTimeout` to 5m and increased the `scroll_size`
to 10_000. Logs after changes:

```
[2024-10-03T11:02:20.381+02:00][DEBUG][plugins.taskManager] Running task security-solution-ea-asset-criticality-ecs-migration "security-solution-ea-asset-criticality-ecs-migration-task-id"
[2024-10-03T11:02:20.382+02:00][DEBUG][execution_context] {"type":"task manager","name":"run security-solution-ea-asset-criticality-ecs-migration","id":"security-solution-ea-asset-criticality-ecs-migration-task-id","description":"run task"}
[2024-10-03T11:02:59.588+02:00][INFO ][plugins.securitySolution.entityAnalytics.migration] Task "security-solution-ea-asset-criticality-ecs-migration" finished. Updated documents: 1020371, failures: 0
```
  • Loading branch information
machadoum authored Oct 4, 2024
1 parent 47d01c3 commit 3d90133
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class AssetCriticalityEcsMigrationClient {
conflicts: 'proceed',
ignore_unavailable: true,
allow_no_indices: true,
scroll_size: 1000,
scroll_size: 10000,
body: {
query: ECS_MAPPINGS_MIGRATION_QUERY,
script: {
Expand All @@ -87,6 +87,7 @@ export class AssetCriticalityEcsMigrationClient {
},
},
{
requestTimeout: '5m',
retryOnTimeout: true,
maxRetries: 2,
signal: abortSignal,
Expand Down

0 comments on commit 3d90133

Please sign in to comment.