Split the groups external cache into 2 caches for better performance The current implementation of the groups external cache used an in-memory cache with a single key "EXTERNAL_NAME" that maps to the list of all external groups. In this change we almost left this cache intact, but modified its loader to retrieve the value (external groups) using a persisted external groups cache. The persistent cache has a key that represents the state of NoteDb, and specifically is the concatenation of the SHA-1 of all internal groups' refs in NoteDb. The persistent cache's loader does the expensive operation of loading the groups from NoteDb. Change-Id: Iac48415589eabec479dc658eaa20c2dd4c7b4932
diff --git a/proto/cache.proto b/proto/cache.proto index 5fc5e68..e0c4400 100644 --- a/proto/cache.proto +++ b/proto/cache.proto
@@ -270,6 +270,15 @@ repeated ExternalIdProto external_id = 1; } +// Serialized form of a list of com.google.gerrit.entities.AccountGroup.UUID +// Next ID: 2 +message AllExternalGroupsProto { + message ExternalGroupProto { + string groupUuid = 1; + } + repeated ExternalGroupProto external_group = 1; +} + // Key for com.google.gerrit.server.git.PureRevertCache. // Next ID: 4 message PureRevertKeyProto {