Handle project deletion

Handle the removal of a project with a soft-delete approach.  Rather
than executing a table scan that might be heavy from a latency and from
a RCUs consumption prospective, we flag the existing items as obsolete
by bumping up a project version refSpec in the form of `|project-name`,
to which we associate the current version `version`.

This way, deleting a project is just as simple as bumping up its version
value.

We then prepend the current version to the refSpec when looking up
items, so that we can easily ignore obsolete entries.

For example, if a project `foo` is deleted a new entry is created as
such:

| refPath | refValue |
| |foo    | 1        |

If then a new project is created, new refSpecs will be prefixed with the
new project version:

| refPath                  | refValue    |
| |1/foo/refs/heads/master | 3355b5b8b73 |

We selected the pipe symbol (|) as a prefix because it is prohibited in
repository names, ensuring no ambiguity arises with actual repository
names.

Change-Id: I2cfdf2e812c9e68735b66eef3b756ec6084bf697
2 files changed
tree: 69e5e39e061529ca4b60511d231a8f4741df268d
  1. src/
  2. BUILD
  3. external_plugin_deps.bzl
  4. Jenkinsfile
  5. LICENSE
  6. README.md
README.md

Gerrit DynamoDB ref-db

This plugin provides an implementation of the Gerrit global ref-db backed by AWS DynamoDB.

Requirements for using this plugin are:

  • Gerrit v3.3 or later
  • DynamoDB provisioned in AWS

Typical use-case

The global ref-db is a typical use-case of a Gerrit multi-master scenario in a multi-site setup. Refer to the Gerrit multi-site plugin for more details on the high level architecture.