Class PeriodicGroupIndexer

  • All Implemented Interfaces:
    Runnable

    public class PeriodicGroupIndexer
    extends Object
    implements Runnable
    Runnable to schedule periodic group reindexing.

    Periodic group indexing is intended to run only on slaves. Replication to slaves happens on Git level so that Gerrit is not aware of incoming replication events. But slaves need an updated group index to resolve memberships of users for ACL validation. To keep the group index in slaves up-to-date this class periodically scans the group refs in the All-Users repository to reindex groups if they are stale. The ref states of the group refs are cached so that on each run deleted groups can be detected and reindexed. This means callers of slaves may observe outdated group information until the next indexing happens. The interval on which group indexing is done is configurable by setting index.scheduledIndexer.interval in gerrit.config. By default group indexing is done every 5 minutes.

    This class is not able to detect group deletions that were replicated while the slave was offline. This means if group refs are deleted while the slave is offline these groups are not removed from the group index when the slave is started. However since group deletion is not supported this should never happen and one can always do an offline reindex before starting the slave.

    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable