Don't check conflicting ref names when deleting refs

The Schema_167 migration was very slow on our production data with about
30K user refs and about 20K groups. This was caused by scanning for all
refs when deleting a ref during migration

When deleting a ref we do not need to check for the conflicting refs
name and can thus avoid the expensive scan for all refs.

Change-Id: I1168bd192fa9c3c8c0791641ef063955d03f35ec
This commit is contained in:
Saša Živkov
2019-12-20 13:39:08 +01:00
committed by Saša Živkov
parent ab3b725da9
commit 522ffdfaad

View File

@@ -119,6 +119,7 @@ public class RefUpdateUtil {
public static void deleteChecked(Repository repo, String refName) throws IOException {
RefUpdate ru = repo.updateRef(refName);
ru.setForceUpdate(true);
ru.setCheckConflicting(false);
switch (ru.delete()) {
case FORCED:
// Ref was deleted.