Slave goes through 'switchToSlave' process on every 'masterIsElected' event
CappedOperation does not trigger on first time event

Previously, a CappedOperation was triggered the first event regardless of
which triggered were specified. This was unexpected and counter intuitive,
especially for cases (where it is most used) where a CappedOperation was
added as a time-based logger and a log statement was expected to be
printed after the specified threshold, it would log immediately as well.
Removes console output from GraphDatabaseServiceTest
Fixes XaLogicalLog shutdown issue

XaLogicalLog.close() was flushing the store files after
 marking the active log file as applied. This could
 lead to recovery not happening if shutdown
 failed within a narrow window between log
 shutdown and store flush. This is now fixed.
The LogBackedXaDatasource defined a stop() method that
 managed log lifecycle without having to. This is now
 removed and log lifecycle control is delegated to
 subclasses through XaContainer.
Fix for #2907, labels on varlength patterns where not checked properly.
Make type rules in Add clearer

Taken from #3235
Merge pull request #3245 from cleishm/type_clearup

[2.0] Make type rules in Add clearer
Merge pull request #3229 from digitalstain/1.9-fix-llog-shutdown

[1.9] fix logical log shutdown
Merge pull request #3227 from tinwelint/1.9-capped-ops-no-first

[1.9] CappedOperation does not trigger on first time event
Merge pull request #3240 from pontusmelke/issue-2907

[2.0] Fix for #2907, labels on varlength patterns where not checked properly.
Merge remote-tracking branch 'upstream/2.0-maint' into 2.1-maint
Fixes BackupServiceIT to properly close log channel after latest changes
Fixes an issue which made it impossible to resume a migration

i.e. when the migration had been completed, and the migration aborted...
when it would be picked up again the next time to do the moving of files
from migration directory to store directory there would be an assumption
that the "migrate" method would have been run before it. This led to an
NPE for an uninitialized field.
Merge remote-tracking branch 'origin/1.9-maint' into 2.0-maint

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/xa/NeoStoreXaDataSource.java
	community/kernel/src/test/java/org/neo4j/graphdb/GraphDatabaseServiceTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/TestXa.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLogTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/util/CappedOperationTest.java
	community/lucene-index/src/main/java/org/neo4j/index/impl/lucene/LuceneDataSource.java
	enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java
Merge remote-tracking branch 'origin/2.0-maint' into 2.1-maint

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/xa/NeoStoreXaDataSource.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLog.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/TestXa.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLogTest.java
	community/lucene-index/src/main/java/org/neo4j/index/impl/lucene/LuceneDataSource.java
	enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java
Updates changelogs for 1.9.9 with last batch of changes
Merge pull request #3252 from tinwelint/2.1-resume-migration-fix

[2.1] Fixes an issue which made it impossible to resume a migration
Merge pull request #3217 from lutovich/1.9-slave-epoch-mismatch

[1.9] Slave goes through 'switchToSlave' process on every 'masterIsElected' event
Merge branch '1.9-maint' into 2.0-maint

Conflicts:
	enterprise/backup/CHANGES.txt
	enterprise/ha/src/test/java/org/neo4j/ha/TestSlaveOnlyCluster.java
Merge branch '2.0-maint' into 2.1-maint

Conflicts:
	enterprise/backup/CHANGES.txt