Page MenuHomePhabricator

Improve performance when marking commits as unreachable after multiple ref deletions
ClosedPublic

Authored by epriestley on Apr 3 2020, 8:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 14 2024, 3:45 PM
Unknown Object (File)
Feb 24 2024, 7:56 AM
Unknown Object (File)
Jan 17 2024, 5:30 AM
Unknown Object (File)
Jan 11 2024, 12:05 PM
Unknown Object (File)
Dec 28 2023, 9:03 AM
Unknown Object (File)
Dec 28 2023, 2:31 AM
Unknown Object (File)
Dec 26 2023, 9:13 AM
Unknown Object (File)
Dec 25 2023, 3:08 PM
Subscribers
None

Details

Summary

See PHI1688. If many refs with a large amount of shared ancestry are deleted from a repository, we can spend much longer than necessary marking their mutual ancestors as unreachable over and over again.

For example, if refs A, B and C all point near the head of an obsolete "develop" branch and have about 1K shared commits reachable from no other refs, deleting all three refs will lead to us performing 3,000 mark-as-unreachable operations (once for each "<ref, commit>" pair).

Instead, we can stop exploring history once we reach an already-unreachable commit.

Test Plan
  • Destroyed 7 similar refs simultaneously.
  • Ran bin/repository refs, saw 7 entries appear in the oldref table.
  • Ran bin/repository discover with some debugging statements added, saw sensible-seeming behavior which didn't double-mark any newly-unreachable refs.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable