Replace AccountGeneralPreferences entity with git backend (phase 1)

Replace the usage of AccountGeneralPreferences with a different class
in extension API package.

To support live migration, the upgrade is done in two steps:

* phase 1 (this change):
  o Always write to both git and db
  o Introduce new configuration option to indicate whether to read from
    git or db, initially set to read from db
  o First binary update: some servers are reading/writing just the db;
    some servers are additionally writing to git
  o After first update: all servers are reading from the db, writing to
    both
  o Batch copy data from db to git (only related to non open source
    Gerrit version)
  o Update all servers to read from git. During the update, some will
    still be reading from the db; that's ok, because everybody is
    writing to git
  o OutgoingEmail class is retrieving copy_self_on_email preference
    always form the database (by getting AccountGlobalPreferences from
    the account cache). This is OK, because all servers are writing to
    the database
* phase 2 (next change):
  o Bump database version, migrate the data from db to git, delete the
    entity (and the flag) from the code and update the servers.

Change-Id: I218d92465665afa0caa01e88ff1fa87f773383eb
This commit is contained in:
David Ostrovsky
2015-10-31 16:09:42 +01:00
committed by David Ostrovsky
parent 70e4a9024a
commit cfb7520322
15 changed files with 704 additions and 268 deletions

View File

@@ -92,8 +92,8 @@ import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.RestApi;
import com.google.gerrit.client.ui.Screen;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView;
import com.google.gerrit.reviewdb.client.Account;
import com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DiffView;
import com.google.gerrit.reviewdb.client.AccountGroup;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.Patch;