ChangeMergeQueue: Fix race condition

To the multiple triggers of submit action belong:

* ChangeMergeQueue.merge() method called from the UI
* ChangeMergeQueue.schedule() method called by background
ReloadSubmitQueueOp

active map in ChangeMergeQueue acts as a guard for submit job
scheduling. However schedule() ignores the fact that the submit
processing was already started for a specific branch and double
submit action is scheduled.

Specifically for cherry-pick submit strategy that cannot end
good and fails with database constraints violation or similar,
depending on the underlying database implementation.

Guard the background scheduling similar to the UI scheduling.

Defining unique index prevents the database corruption: [1], [2]
but not the collision between manual and background merge jobs.

[1] http://paste.openstack.org/show/83883
[2] http://paste.openstack.org/show/83888

Bug: issue 2034
Bug: issue 2383
Bug: issue 2702
Change-Id: I5b23f9d481351280e26412b82b525947338d9c00
Add missing 'link:' in 2.8.5 release notes

Change-Id: I6268999ab31dd26b829b650d98d076f7223868bd
Release notes for Gerrit 2.8.6

Change-Id: I72451095da8ee6973fbe140edbf9954420b2b795
Bump API version to 2.8.6

Change-Id: I358bca8e7187c50ddb2ca71498d130927fb1aeda
Executing CherryPick.writeCherryPickCommit() in a transaction.

This would at least allow the partial changes to the
database to rollback and not get users in a bad state when
e.g. in the case of OrmDuplicateKeyException: patch_set_ancestors'.

Bug: issue 2034
Bug: issue 2246
Change-Id: I65e111bedc3cec033299b5b5360aaee733d4b5c6
(cherry picked from commit eb4778d079e7156c82d04c2f26c71ca89d12df16)
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8:
  Executing CherryPick.writeCherryPickCommit() in a transaction.
  Bump API version to 2.8.6
  Release notes for Gerrit 2.8.6
  Add missing 'link:' in 2.8.5 release notes
  ChangeMergeQueue: Fix race condition

Conflicts:
	VERSION
	gerrit-plugin-archetype/pom.xml
	gerrit-plugin-gwt-archetype/pom.xml
	gerrit-plugin-gwtui/pom.xml
	gerrit-plugin-js-archetype/pom.xml
	gerrit-server/src/main/java/com/google/gerrit/server/git/strategy/CherryPick.java

Change-Id: I06fba0020457de66f68ac2b5675e9d57bf75d750