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
F14095437: D21056.diff
Mon, Nov 25, 9:19 PM
Unknown Object (File)
Sun, Nov 24, 8:26 AM
Unknown Object (File)
Fri, Nov 22, 5:08 PM
Unknown Object (File)
Mon, Nov 18, 3:34 PM
Unknown Object (File)
Thu, Nov 14, 3:01 PM
Unknown Object (File)
Sun, Nov 10, 9:11 AM
Unknown Object (File)
Wed, Nov 6, 12:57 AM
Unknown Object (File)
Mon, Nov 4, 2:36 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
Branch
unreachable1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23983
Build 33007: Run Core Tests
Build 33006: arc lint + arc unit