aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-09-19 11:55:25 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-09-19 11:55:25 -0400
commitadce778f2fdafdbf2569da846dbd787ed2c589b6 (patch)
tree7a8630045534db1855c3f4c10f3970fc3d2aae7d
parent777df45ac282ec96bb2209c783696ec221bd3df6 (diff)
downloadgrokmirror-adce778f2fdafdbf2569da846dbd787ed2c589b6.tar.gz
Force conn-only checks on repos using objstore
There's no need to run full fsck on repositories that use objstore repos, because we'll end up checking the same objects over and over again. Just check connectivity and let full fsck run happen on the actual objstore repo. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgrokmirror/fsck.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/grokmirror/fsck.py b/grokmirror/fsck.py
index 0556afb..9549e19 100755
--- a/grokmirror/fsck.py
+++ b/grokmirror/fsck.py
@@ -329,6 +329,12 @@ def run_git_repack(fullpath, config, level=1, prune=True):
def run_git_fsck(fullpath, config, conn_only=False):
args = ['fsck', '--no-progress', '--no-dangling', '--no-reflogs']
+ obstdir = os.path.realpath(config['core'].get('objstore'))
+ # If it's got an obstrepo, always run as connectivity-only
+ altrepo = grokmirror.get_altrepo(fullpath)
+ if altrepo and grokmirror.is_obstrepo(altrepo, obstdir):
+ logger.debug('Repo uses objstore, forcing connectivity-only')
+ conn_only = True
if conn_only:
args.append('--connectivity-only')
logger.info(' fsck: running with --connectivity-only')