Provide the group index in slave mode

With groups in NoteDb, we need the group index to quickly determine the
parent groups of a subgroup or the groups of which a specific account is
a member. These details are necessary for the evaluation of ACLs, and
hence are also required for Gerrit hosts which run in slave mode.

Up to now, we circumvented this issue by still delegating to the
ReviewDb implementation. However, we intend to remove the ReviewDb code
for groups soon and therefore need a working solution for NoteDb.

This change only activates the group index for hosts in slave mode. It
doesn't ensure that the index stays up to date. That aspect will be
handled by a follow-up change.

Change-Id: Idc7bd2bf3aa30f73394da61ea917ae4d47f52c84
This commit is contained in:
Alice Kober-Sotzek
2018-02-08 16:09:50 +01:00
committed by Edwin Kempin
parent cc5b97a26f
commit a264642001
12 changed files with 116 additions and 72 deletions

View File

@@ -203,9 +203,11 @@ public class MigrateToNoteDb extends SiteProgram {
private Module getIndexModule() {
switch (IndexModule.getIndexType(dbInjector)) {
case LUCENE:
return LuceneIndexModule.singleVersionWithExplicitVersions(ImmutableMap.of(), threads);
return LuceneIndexModule.singleVersionWithExplicitVersions(
ImmutableMap.of(), threads, false);
case ELASTICSEARCH:
return ElasticIndexModule.singleVersionWithExplicitVersions(ImmutableMap.of(), threads);
return ElasticIndexModule.singleVersionWithExplicitVersions(
ImmutableMap.of(), threads, false);
default:
throw new IllegalStateException("unsupported index.type");
}