Merge remote-tracking branch 'upstream/2.0-maint' into 2.1-maint

Conflicts:
	enterprise/ha/src/main/java/org/neo4j/kernel/ha/HighlyAvailableGraphDatabase.java
Fix state bug from upgrading a shared lock using tryExclusive()

If a shared lock is held when sharedExclusive was called, the local lock
state in the client would not be updated properly, instead the call would
return early from this code path. It should have continued the loop to acquire
locks, and it should have updated the local lock map state.

Now it does, this appears to have been a copy-paste error.
Merge pull request #2702 from jakewins/2.1-release-upgrade-try

Fix state bug from upgrading a shared lock using tryExclusive()
Merge pull request #2701 from davidegrohmann/merge-2.0-into-2.1

Merge 2.0 into 2.1
Make Cypher not introduce eagerness in some trivially decidable cases

In particular, we do not want the plan for:

```MATCH a, b CREATE (a)-[r:X]->(b)```

to contain an EagerPipe.
Merge pull request #2687 from jakub-/read-write-interference

Less eagerness for Cypher
Updated changelogs in preperation for 2.1.3
Make Maven happier about the new integrationtests module
Merge pull request #2706 from chrisvest/2.1-integrationtests

Make Maven happier about the new integrationtests module
Merge pull request #2705 from chrisvest/2.1.3-changelogs

Updated changelogs in preperation for 2.1.3
Fix .localEffects for DistinctPipe
Change all pipes to properly report their effects

Conflicts:
	community/cypher/cypher-compiler-2.1/src/main/scala/org/neo4j/cypher/internal/compiler/v2_1/pipes/DistinctPipe.scala
Fixing up some oddly worded parts of the caching documentation.
Make sure not to hit the parser on every Cypher query in the server
Refactoring: Split query preparation between parsing and plan building

Rationale: This makes it possible to check if a query isPeriodicCommit without having to open a transaction

Signed-off-by: Jakub Wieczorek <jakub@neotechnology.com>
Avoid opening two transactions per single request REST transaction

This introduces caching of PreparedQueries in ExecutionEngine.  The cache adds a tiny overhead for all calls to execute/profile
but this is much less than opening two transaction just to check if a query isPeriodicCommit.

While it would be possible to tie the prepared queries cache and the plan cache together, this would complicate matters
with plan cache flushing, hence we don't do that for now.

Signed-off-by: Jakub Wieczorek <jakub@neotechnology.com>
Merge pull request #2711 from jakub-/server-parser-hotspot

Server hotspot around parsing too often and opening unnecessary tx
Fix shadowing issues with aggregation in Ronja

Signed-off-by: Stefan Plantikow <stefan.plantikow@neotechnology.com>
Only hit prepared query cache when planning (avoid extra lookup)

signed-off-by: Jakub Wieczorek <jakub.wieczorek@neotechnology.com>
Fix: Correctly isolate aggregates from expressions that introduce interior scopes (reduce, fitler, extract, comprehensions)

signed-off-by: Jakub Wieczorek <jakub.wieczorek@neotechnology.com>