Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Added a new GHE_REMOTE_GIT_FSCK option #225
Conversation
Run git fsck remotely after a restore and report the results. Looks something like: ``` Restoring MySQL database ... --> Importing MySQL data... Restoring Redis database ... Restoring Git repositories into cluster ... Restoring Gists into cluster ... Checking remote git repositories ... Running git fsck on ghe-test-cluster-migration-node1 ... * Repos verified: 4, Errors: 1, Took: 5s Running git fsck on ghe-test-cluster-migration-node2 ... * Repos verified: 4, Errors: 0, Took: 5s Running git fsck on ghe-test-cluster-migration-node3 ... * Repos verified: 4, Errors: 0, Took: 4s Running git fsck on ghe-test-cluster-migration-node4 ... * Repos verified: 3, Errors: 0, Took: 4s ``` When the verbose mode is enabled: ``` Restoring MySQL database ... --> Importing MySQL data... Restoring Redis database ... Restoring Git repositories into cluster ... Restoring Gists into cluster ... Checking remote git repositories ... Running git fsck on ghe-test-cluster-migration-node1 ... ERROR /data/user/repositories/c/nw/c8/1e/72/2/2.git ghe-admin/test2 1s error: HEAD: invalid sha1 pointer 8dc523028e592fb72020f6f1901ac033e326eebb error: refs/heads/master: invalid sha1 pointer 8dc523028e592fb72020f6f1901ac033e326eebb error: refs/heads/master: invalid reflog entry 8dc523028e592fb72020f6f1901ac033e326eebb notice: No default references * Repos verified: 4, Errors: 1, Took: 5s Running git fsck on ghe-test-cluster-migration-node2 ... * Repos verified: 4, Errors: 0, Took: 5s Running git fsck on ghe-test-cluster-migration-node3 ... * Repos verified: 4, Errors: 0, Took: 4s Running git fsck on ghe-test-cluster-migration-node4 ... * Repos verified: 3, Errors: 0, Took: 4s ``` It will exit 1 if the remote fsck fails and GHE_REMOTE_GIT_FSCK_ABORT_ON_ERROR=yes, warn otherwise. Note: git fsck is quite expensive and slow on large installs and for now it's only useful for debugging/troubleshooting so the new option is disabled by default.
|
|
|
Do you still want this in backup-utils @rubiojr? |
None |
Would be worth double checking if this still works before merging, it's been a while. |
It's already defined and test friendly.
It's risky and not cross-platform
Run git fsck remotely after a restore and report the results.
Looks something like:
When the verbose mode is enabled:
It will exit 1 if the remote fsck fails and GHE_REMOTE_GIT_FSCK_ABORT_ON_ERROR=yes,
warn otherwise.
Note: git fsck is quite expensive and slow on large installs and for now it's only
useful for debugging/troubleshooting so the new option is disabled by default.
/cc @github/backup-utils