=act #13942 Avoid allocations in LoggingReceived when disabled
=per #15459 Use full batching for persistAsync and defer

(cherry picked from commit 20ac844b4f3999d0261f1a08957c2c2a8367c672)

Conflicts:
	akka-bench-jmh/src/main/scala/akka/persistence/PersistenceActorDeferBenchmark.scala
=act #15361 Require non-abstract actor class (earlier)

* It was detected previously as well when trying to find constructor,
  but with a perhaps confusing error message

(cherry picked from commit 15e964b13e91962474c7907787c37121aae8fd4e)
=doc #13965 Fix wrong code sample for BalancingPool

(cherry picked from commit 24ce0605ac954d516a52d9ce14624414c1c79933)
+act #15284 Add throws TimeoutException to Inbox.receive

(cherry picked from commit ab19cc8a527f1a01a8180c2b199affcb47e5b1d2)
Merge pull request #15414 from akka/wip-13942-LoggingReceive-optimization-patriknw

=act #13942 Avoid allocations in LoggingReceived when disabled
Merge pull request #15463 from akka/wip-15459-persistAsync-batching-master-patriknw

=per #15459 Use full batching for persistAsync and defer (for validation)
Merge pull request #15464 from akka/wip-13965-15361-master-patriknw

#13965 #15361 cherry picks to master (for validation)
Merge pull request #15465 from akka/wip-15284-throws-annotation-master-patriknw

+act #15284 Add throws TimeoutException to Inbox.receive
!per #15428 Deprecate deleteMessage

(cherry picked from commit 4973d0b37d635a0a2c9a94c2898da988e4f14fc7)
!per #15427 Deprecate deleteMessage and writeConfirmations in journal plugin api

(cherry picked from commit 4c271b6b092989ebde26fcd135e6ad56f797a763)
!per Additional deprecations and cleanup

(cherry picked from commit 98619647e372121fb3c2072a0eab20de4148f7d9)

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/snapshot/SnapshotStore.scala
!per Change for journal plugin compatibility

* A few more adjustments, found when verifying source compatibility of a few
  journal plugins
* Note that PersistentId will be removed with deleteMessage and we should
  not break plugins because of that
* Add missing section of at-least-once delivery in migration guide

(cherry picked from commit 6727eac6d07280d277968e2e25db44e02be3b102)

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/main/scala/akka/persistence/Snapshot.scala
	akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteProxy.scala
=per #15457 Correlate persistAsync handlers with journal messages

We have assumed that the handlers can be popped when replies come back from journal, but if messages to journal are in flight when the actor is restarted the handlers does not match up with journal replies.

This solution ignores journal replies that were emitted by an old PersistentActor instance
by passing an uid with the journal messages. This means that the handler will not be
invoked for such messages.

(cherry picked from commit 7ebaaab669c9e467a1ffb4d9ed8b6500e1801a7c)

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteJournal.scala
=per #15441 Remove persistent stream in docs and sample

We must first release akka-stream with dependency to akka 2.3.4
and it should be maintained in the akka-release-dev branch

(cherry picked from commit a97a067701cfc527b235707882e72326277415f3)

Conflicts:
	akka-samples/akka-sample-persistence-scala/build.sbt
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/StreamExample.scala
=per Fix minor doc issues

(cherry picked from commit 45c07e1f2f131e70a03b82803f11fd390572ccba)
Merge pull request #15468 from akka/wip-various-pick-master-patriknw

Persistence cherry picks to master (for validation)
=con #15440 Add invariant checks to ClusterSharding state

* I suspect that the issue #15440 happens because of replay of events
  in wrong order (ShardHomeAllocated received before ShardRegionRegistered)
  by the hbase journal
* This does not fix that issue, but the additional invariant checks and
  debug statements  would perhaps make it easier for us to diagnose such
  issues
* These changes also ensures that the allocation strategy does not return
  the wrong thing.
* It also tightens a possible error if a region is terminated while a
  rebalance is in progress

(cherry picked from commit d07b9db4958236d580b8bfb8f92461969ff88cbc)
=per #15472 Flush instead of unstash when PersistentActor restarts

* When using the Processor batching buffer for persistAsync and defer
  the events were unstashed by Processor.aroundPreRestart and
  thereby were received as commands after restart
* Instead we must flush this buffer when using PersistentActor

(cherry picked from commit 627ce2fc85739e221524ec48725362ef7c0566ea)
Merge pull request #15476 from akka/wip-15472-15440-picks-master-patriknw

#15472 #15440 picks to master (for validation)