Don't use this script for this purpose, it deletes all noteDB data,
you don't want that to get rid of some corrupted entries.
See the script's description:
This util script can be used in case of rollback to ReviewDB during an unsuccessful
migration to NoteDB or simply while testing the migration process.
It will remove all the refs used by NoteDB added during the migration (i.e.: change meta refs and sequence ref)
Check which refs exist for the affected changes. Do that by grepping the output of git show-ref
run on the respective git repository. E.g. for change 121:
$ git show-ref | grep refs/changes/21/121
cd623d447ed125d004369e96e96141da189342d9 refs/changes/21/121/1
6c1de686f91e5b26b22d999339a6b9c23999524e refs/changes/21/121/2
f320b3b6a8450acae43732dab59c944c4b4367d7 refs/changes/21/121/meta
A Gerrit change consists of 1..n patchsets, here patchset 1 (refs/changes/21/121/1) and 2 (refs/changes/21/121/2),
and the corresponding meta ref (refs/changes/21/121/meta).
If the meta ref of a change went missing it's impossible to fully reconstruct if you don't find it in a backup or replica.
In that case first check if the commits the patchsets refer to are reachable from any branch or tag:
e.g. for the patchset refs/changes/21/121/1:
$ git branch --contains cd623d447ed125d004369e96e96141da189342d9
$ git tag --contains cd623d447ed125d004369e96e96141da189342d9
If the result of both these commands is empty this commit will become unreachable
if you delete the patchset's ref (here refs/changes/21/121/1). This implies that
git gc will delete it when the prune interval has passed.
In that case look at the commits diff to decide if you want to keep it or not:
$ git show 6c1de686f91e5b26b22d999339a6b9c23999524e
commit 6c1de686f91e5b26b22d999339a6b9c23999524e
Author: Matthias Sohn <
matthi...@sap.com>
Date: Wed Nov 30 16:13:31 2022 +0100
a7
Change-Id: I8f1483bbe16abd7181e7eb732eb47b9708d00cc7
diff --git a/a.txt b/a.txt
index 5b521d0..f1914bb 100644
--- a/a.txt
+++ b/a.txt
@@ -1 +1 @@
-a6
+a8
For the other error: