Page MenuHomeSoftware Heritage

Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes
ClosedPublic

Authored by olasd on Jun 19 2020, 4:52 PM.

Details

Summary

On uffizi, this query would use the snapshot_branch (name, target, target_type) index, which would match way too many rows and take forever.

Test Plan

tested the new function in a temp session on uffizi

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12971
Build 19765: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 19764: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D3320 (id=11760)

Rebasing onto 16009078bc...

Current branch diff-target is up to date.
Changes applied before test
commit 20afcdc61ebe0b84ad65fc3702cd9949045c0ece
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jun 19 16:46:42 2020 +0200

    Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/315/ for more details.

Thanks ! I could not reproduce locally because I was not using the belvedere db. Switching to it effectively made the timeout issue appear.

This revision is now accepted and ready to land.Jun 19 2020, 5:15 PM

Add some comments to explain the rationale behind the function change

Build is green

Patch application report for D3320 (id=11761)

Rebasing onto 16009078bc...

Current branch diff-target is up to date.
Changes applied before test
commit 9514a1db60449ad9188e059b2214f5f5c39f4042
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jun 19 16:46:42 2020 +0200

    Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/316/ for more details.