Page MenuHomePhabricator

Diffusion commit count is incorrect after forced push
Closed, DuplicatePublic

Event Timeline

asherkin raised the priority of this task from to Needs Triage.
asherkin updated the task description. (Show Details)
asherkin added a project: Diffusion.
asherkin added a subscriber: asherkin.

This might be a symptom of T2581.

In T5715#4, @epriestley wrote:

This might be a symptom of T2581.

It's a hosted repo, but that seems plausible.

This is probably quite complicated, since it's hard for us to detect that commits are gone from a repository.

For one, we probably should not destroy Commit objects when the underlying commits are destroyed, but mark them with some isSpookyGhost flag, to preserve any metadata (links, transactions, comments) on them. This will also let you fix a mistake by pushing the correct commits back (if the force push was an error) without losing everything. In the UI, we would call out "spooky ghost" commits as "this previously existed, but now it is gone".

A good first step might be to build a bin/repository sync workflow or similar, which just checks that every commit in the repository still exists, and flags it as a spooky ghost if it does not. This could be slow and iterative, and would solve the original problem in this task. (With a tweak to the summary query to make it only count non-spooky commits).

Daemons could then be adjusted to bail gracefully when encountering spooky ghosts, and other tools like bin/repository importing and the importing count queries could be aware of them.

Finally, we could trigger some kind of spooky ghost process when we saw a non-fastforward branch operation during an update. It would take the old branch head and walk backward from it, identifying and marking spooky ghosts. Once this worked properly, sync could be a pure debugging flow.

epriestley triaged this task as Normal priority.Aug 12 2014, 3:43 PM
eadler added a project: Restricted Project.Jan 20 2016, 7:27 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Feb 8 2016, 5:12 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Feb 18 2016, 6:31 PM

I'm going to merge this into T9028. Specifically, D16133 rebuilds the summary table after any commit becomes unreachable, which should produce the correct commit count and other summary details.