Don't propagate cache eviction for the project_list cache

When a new project is created, or deleted, the cache list of projects is
atomically updated and replaced in the project_list cache. Since the
replacement effectively removes the old value and puts new value in the
cache guava triggers a CacheRemovalListener.onRemoval(...) for the old
value. This eviction event was then propagated to the other node and
the project_list cache was flushed completely on that node. A subsequent
access on the project_list cache on that node will do a full scan for
projects which can take 20-30 seconds on a Gerrit server with a large
number of repositories.

The above described behaviour is usually not a problem when HA is run in
active/inactive setup. Flushing of the project_list cache would always
happen in the inactive node only. Only on switching instances would the
new active node be forced to once re-scan for projects.

In an active/active setup this issue has a high performance penalty and
we must avoid re-scan for projects. Therefore, instead of propagating
cache eviction for the project_list cache use the project-created and
project-deleted events to (atomically) update the project_list cache on
the other node.

Also-by: Saša Živkov <sasa.zivkov@sap.com>
Change-Id: I100a6cd24d820fb75740cf479219b897f59ac713
15 files changed