Skip to content
Snippets Groups Projects
Commit 8e8577e8 authored by vlorentz's avatar vlorentz
Browse files

Prevent erroneous HashCollisions by using the same ctime for all rows.

'swh_content_add' tries to avoid this issue with a DISTINCT clause
on the entire row; but it is useless because 'ctime' cells differ by
a few microseconds.
This commit ensures all ctime values are exactly the same, so they
are filtered out.

An alternative would be to change 'swh_content_add' to do:

```
select distinct on (sha1, sha1_git, sha256, blake2s256, length, status) sha1, sha1_git, sha256, blake2s256, length, status, ctime from tmp_content
```

instead of:

```
select distinct sha1, sha1_git, sha256, blake2s256, length, status, ctime from tmp_content
```

but this is more verbose and there's no good reason to call 'now()' for
every row.
parent 82b41bac
No related branches found
No related tags found
1 merge request!926Prevent erroneous HashCollisions by using the same ctime for all rows.
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment