gerrit/gerrit-oauth
David Ostrovsky 1eb5429227 ExternalIds NoteDb migration: Avoid intermediate migration state
The problem we are facing on the stable-2.14 branch is: we have
intermediate NoteDb migration state for accounts entity due to
merge of: Ic9bd5791e84. That why we are writing to both backends:
ReviewDb and NoteDb. It creates potential risk to be out of sync
between ReviewDb and NoteDb (and secondary index). In addition it
is always bad from performance point of view to unnecessary write
to 2 different backends. The real migration to NoteDb for accounts
entities (phase 2) happens in: Ia1dae9306b7 and Schema_144, that is
migrating the external IDs from ReviewDb to NoteDb, and that change
is not a part of stable-2.14.

In retrospective, we shouldn't include partially migrated code paths
for the production releases. It's error prone and bad for the
performance. Originally, multi-phase upgrade procedure was done on
master only to support multi master and zero downtime upgrades. These
feature is not related to open source gerrit version.

Moreover, now, that we are facing intermittent account corruption
problems: Issue 7652 that is hard to track down, understand and fix,
we are seeing automatic recovery attempt: [1], that is trying to
detect database corruption and synchronize both backends. This change
takes a different approach and avoids two backends where only ReviewDb
is actually used on production release line 2.14.

To avoid fixing too many caller sites the interfaces of ExternalIds,
ExternalIdsOnInit, ExternalIdsBatchUpdate and ExternalIdsUpdate are
mostly preserved, but the code paths for NoteDb mutations is dropped.

This partially reverts commit 744d2b8967.

[1] https://gerrit-review.googlesource.com/162450

Change-Id: Iec8d0c5639e462d88a7c5d0906febfd6f3337277
2018-03-07 21:35:20 +01:00
..
src/main ExternalIds NoteDb migration: Avoid intermediate migration state 2018-03-07 21:35:20 +01:00
BUILD Migrate external IDs to NoteDb (part 1) 2017-02-28 09:09:39 +01:00