Skip to content

cmd/gitserver: Conditionally update clone_status

Warren Gifford requested to merge ig/gitserver-cleanup-bug into main

Created by: indradhanush

In the cleanup task maybeDeleteWrongShardRepos, we delete the repo from disk in the wrong shard and also end up updating the clone status to not_cloned.

This is an unintended side effect. The wrong shard should perform no DB state changes and ultimately it is the responsibility of the correct shard. In the most likely scenario, this repo is already cloned and owned by the correct gitserver shard and this task should only care about freeing up the disk space in it's own home.

First reported in https://github.com/sourcegraph/customer/issues/1127.

Test plan

Added new test.

Merge request reports

Loading