Skip to content

Conversation

rohanpm
Copy link
Member

@rohanpm rohanpm commented Aug 22, 2021

For RPM units in Pulp, the SHA256 checksum is stored in two places: once
in a 'checksums' dict and once again in a top-level 'checksum' field.

We previously used the former, but only the latter is indexed (being a
part of the unit key). Switching to 'checksum' can make searches much
faster (and can make the difference between a search being feasible at
all or being unusably slow), so let's do that.

This should be safe, as I have confirmed in the Pulp code (linked
within) that the checksum field is always forced to sha256, and also
verified on our live systems that there are no units with a
checksumtype!='sha256'.

Motivation: noticed some queries were slower than expected while working
on RHELDST-5435.

For RPM units in Pulp, the SHA256 checksum is stored in two places: once
in a 'checksums' dict and once again in a top-level 'checksum' field.

We previously used the former, but only the latter is indexed (being a
part of the unit key). Switching to 'checksum' can make searches much
faster (and can make the difference between a search being feasible at
all or being unusably slow), so let's do that.

This should be safe, as I have confirmed in the Pulp code (linked
within) that the checksum field is always forced to sha256, and also
verified on our live systems that there are no units with a
checksumtype!='sha256'.

Motivation: noticed some queries were slower than expected while working
on RHELDST-5435.
@rohanpm rohanpm marked this pull request as ready for review August 23, 2021 00:08
@rohanpm rohanpm requested a review from a team August 23, 2021 00:09
@rohanpm rohanpm merged commit 42ac66f into release-engineering:master Aug 23, 2021
@rohanpm rohanpm deleted the use-faster-checksum branch August 23, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants