Skip to content

Update location fingerprint for Container Scanning Findings

Can Eldem requested to merge update-lf-for-cs into master

What does this MR do?

We are changing way we generate hash for location_fingerprint column for CS(container scanning) findings. This MR updates existing findings. Application code has been deployed

Related issues

Similar MR has been reverted before !41737 (merged) . This is for mitigating those problems

Queries

SELECT id, 
       raw_metadata::json->'location' AS loc 
FROM   "vulnerability_occurrences" 
WHERE  "vulnerability_occurrences"."report_type" = 2 limit 1000

https://explain.depesz.com/s/hAqj

UPDATE "vulnerability_occurrences" SET "location_fingerprint" = '\x43dcc8b28550993b1f8c1ca2d09d324e26bf5ac4' WHERE "vulnerability_occurrences"."id" = 239934 

https://explain.depesz.com/s/iCE6O

Estimated times

  • 49 ms for select statement with 1000 items

  • 32 ms each update statement

  • 883_000/1000 = 883 loop

  • 1000 * 32ms = 32_000 ms each loops update time

  • 32_049 * 816 = 26_151_984 (~435 min)

  • 1632 (waiting min) + 435 = 2067 min

  • 34 hours 45 min estimated running time

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Edited by Can Eldem

Merge request reports