Handle the new enum value PrimaryStorage.NOTE_DB. When updating a
change, if its state indicates NoteDb is the source of truth, we don't
have to bother writing to ReviewDb, including to update the
NoteDbChangeState. This means that NoteDb and ReviewDb will get out of
sync, and we would need a separate migration process to copy data from
NoteDb back to ReviewDb, not yet implemented.
Many code changes here come from the fact that various handlers
manually delete entities from ReviewDb, where the keys may now have
originally been read from NoteDb. Since we now don't write new
entities to ReviewDb, trying to delete non-existent keys will fail
with OrmConcurrencyException. In fact the transaction would have been
rolled back later in BatchUpdate, so the delete would never really
take effect, but unfortunately gwtorm actually throws at the call site
of delete, prior to committing the transaction.
This change supports changes in in the database with PrimaryStorage ==
NOTE_DB, but does not yet implement a migration path. In the new
acceptance tests, we just set the state manually.
Change-Id: If177aa0b9666f9d14869552c661d5aa8b86ead3b