Add experiment flag to disable change etags

Etags help to avoid unnecessary recomputation of responses, e.g. for
changes we compute an etag, and when the client presents this etag and
the change hasn’t been updated, we do not need to recompute the change
info, but we can return '304 Not Modified'.

Etags work well when they are cheap to compute, but that’s not the case
for our change etags. To give one example for what makes the change etag
computation slow, we include the known groups of the current user to
ensure that the etag changes when the group memberships of the current
user change, because that may impact the permitted labels that are
returned with change info, and getting the known groups is expensive if
there are group backends that need to retrieve them from third-party
systems (actually the same issue exists for the reviewers as well since
permitted labels are also returned for them, but for them we do not
include known groups).

Etags need to be computed when a response is returned (to include the
etag into the response) and when the client presents an etag (to check
whether the etag has changed).

Skipping the etag computation means that we can safe the time for
computing the etag, in exchange for this we need to recompute the change
info even if the change hasn't been updated (when the client presented
an etag and the etag hadn't changed):

1. Change is requested without presenting an etag:
* latency before: change computation + etag computation (to return it
  with the response)
* latency after: change computation

2. Change is requested with etag, but the etag doesn't match:
* latency before: etag computation (to compare against the presented
  etag) + change computation + etag computation (to return it with the
  response)
* latency after: change computation

3. Change is requested with etag and the etag matches:
* latency before: etag computation (to compare against the presented
  etag)
* latency after: change computation

Skipping the etag computation is a performance gain for the cases 1. and
2. For case 3. the change computation is likely similar expensive as the
etag computation, so that we probably don't lose (much) performance
here.

Since we are not 100% sure about the effect, we protect skipping change
etags with an experiment flag, so that we can measure the impact safely
before removing the change etag computation for good.

Bug: Google b/336400432
Release-Notes: skip
Change-Id: Ib1ca473180d930c3cea0ade3b528ece34f295b5a
Signed-off-by: Edwin Kempin <ekempin@google.com>
4 files changed
tree: 3b6edd6a9b91f0b3063dc319ddffa1b15d345541
  1. .github/
  2. .settings/
  3. .ts-out/
  4. antlr3/
  5. contrib/
  6. Documentation/
  7. e2e-tests/
  8. java/
  9. javatests/
  10. lib/
  11. modules/
  12. plugins/
  13. polygerrit-ui/
  14. prolog/
  15. prologtests/
  16. proto/
  17. resources/
  18. tools/
  19. webapp/
  20. .bazelignore
  21. .bazelproject
  22. .bazelrc
  23. .bazelversion
  24. .editorconfig
  25. .git-blame-ignore-revs
  26. .gitignore
  27. .gitmodules
  28. .gitreview
  29. .pydevproject
  30. .zuul.yaml
  31. BUILD
  32. COPYING
  33. INSTALL
  34. Jenkinsfile
  35. MODULE.bazel
  36. package.json
  37. README.md
  38. SUBMITTING_PATCHES
  39. version.bzl
  40. web-dev-server.config.mjs
  41. WORKSPACE
  42. yarn.lock
README.md

Gerrit Code Review

Gerrit is a code review and project management tool for Git based projects.

Build Status Maven Central

Objective

Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.

Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.

Documentation

For information about how to install and use Gerrit, refer to the documentation.

Source

Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.

Reporting bugs

Please report bugs on the issue tracker.

Contribute

Gerrit is the work of hundreds of contributors. We appreciate your help!

Please read the contribution guidelines.

Note that we do not accept Pull Requests via the Github mirror.

Getting in contact

The Developer Mailing list is repo-discuss on Google Groups.

License

Gerrit is provided under the Apache License 2.0.

Build

Install Bazel and run the following:

    git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
    cd gerrit && bazel build release

Install binary packages (Deb/Rpm)

The instruction how to configure GerritForge/BinTray repositories is here

On Debian/Ubuntu run:

    apt-get update && apt-get install gerrit=<version>-<release>

NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.

On CentOS/RedHat run:

    yum clean all && yum install gerrit-<version>[-<release>]

On Fedora run:

    dnf clean all && dnf install gerrit-<version>[-<release>]

Use pre-built Gerrit images on Docker

Docker images of Gerrit are available on DockerHub

To run a CentOS 8 based Gerrit image:

    docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8

To run a Ubuntu 20.04 based Gerrit image:

    docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20

NOTE: release is optional. Last released package of the version is installed if the release number is omitted.