Commit graph

41 commits

Author SHA1 Message Date
Patrik Nordwall
85be3045bb !per #17249 Avoid init problems of persistence tck
* in the end TestKitBase eagerly initialize the ActorSystem and
  to avoid the need for using lazy val tricks I changed the trait
  to abstract class with config constructor parameter
2015-05-06 14:20:40 +02:00
Julian Tescher
00f6a58e7c Changes all occurances of Typesafe copyright to extend to 2015 2015-03-10 14:12:19 -07:00
Andrei Pozolotin
18dfd39686 +per #15587 Make it possible to use multiple persistence plugins 2015-02-19 21:25:52 -06:00
Roland Kuhn
a029a90502 fix warnings in contrib, docs, osgi, persistence and slf4j 2015-02-06 18:45:58 +01:00
Andrei Pozolotin
7b9f77a073 + akka-cluster-metrics: new akka module
* new akka module split from akka-cluster
* provide sigar provisioning
* fix ewma usage
* resolve #16121
* see #16354
2015-01-19 10:23:54 -06:00
Patrik Nordwall
c566d5a106 per #15423 Remove deprecated features from akka-persistence
* remove channels
* remove View
* remove Processor
* collapse the complicated internal state management
  that was spread out between Processor, Eventsourced and Recovery
* remove Recovery trait, this caused some duplication between Eventsourced
  and PersistentView, but but the enhanced PersistentView will not be based
  on recovery infrastructure, and therefore PersistentView code will be replaced anyway
* remove PersistentBatch
* remove LoopMessage
* remove deleteMessages of individual messages
* remove Persistent, PersistentRepr and PersistentImpl are kept
* remove processorId
* update doc sample code
* note in migration guide about persistenceId
* rename Resequencable to PersistentEnvelope
2014-12-12 16:18:47 +01:00
Marek Prochera
b43f3639d6 Fix #16364 - Doc - Persistent actor - clarification of the recovery customization 2014-11-25 23:13:16 +01:00
Patrik Nordwall
1ffd05db49 =act #13981 Encode name of Balancing dispatcher config path 2014-08-29 12:33:18 +02:00
Viktor Klang
cd8e97c060 +act - 15757 - Reworks implementation of ActorSystem shutdown
* deprecates awaitTermination, shutdown and isTerminated
  * introduces a terminate-method that returns a Future[Unit]
  * introduces a whenTerminated-method that returns a Future[Unit]
  * simplifies the implementation by removing blocking constructs
  * adds tests for terminate() and whenTerminated
2014-08-25 15:49:28 +02:00
Konrad 'ktoso' Malawski
90bc347607 +per #13815 akka-persistence-tck based on @krasserm's work
Original here: https://github.com/krasserm/akka-persistence-testkit

New features:
* merged martin's tests
* usable from java (junit 4)
* simple bench test, which helps checking if ordering is perserved under
  bigger workloads and simple perf checking
* does NOT include tests for already deprecated features (deleteMessages)
* docs

Resolves #13815

Conflicts:
	project/AkkaBuild.scala
2014-07-14 19:39:30 +02:00
Pavel Zalunin
f730b60bd9 =doc,sam RecoveryCompleted handled by receiveRecover typo 2014-07-03 13:58:14 +03:00
Patrik Nordwall
bc2aeaf0d3 =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
2014-06-28 17:24:25 +02:00
Patrik Nordwall
33c7f6bb4f !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
2014-06-28 17:11:06 +02:00
Patrik Nordwall
32ca608c97 +per #15327 Add AtLeastOnceDelivery trait
* also remove final of around methods, and let deliver send when not recoveryRunning

(cherry picked from commit 312b0d107a179accaf135f64ed9c3b78f3e351d1)
2014-06-26 22:58:46 +02:00
Konrad 'ktoso' Malawski
b1d1d87111 !per #15436 make persistenceId abstract in NEW classes
(cherry picked from commit de3249f7f4b859c3caa232e579d9a3bae7406803)

Conflicts:
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/PersistentActorExample.scala
2014-06-26 16:29:30 +02:00
Konrad 'ktoso' Malawski
3fd240384c +per #15424 Added PersistentView, deprecated View
A PersistentView works the same way as View did previously, except:

* it requires an `peristenceId` (no default is provided)
* messages given to `receive` are NOT wrapped in Persistent()

akka-streams not touched, will update them afterwards on different branch

Also solves #15436 by making persistentId in PersistentView abstract.

(cherry picked from commit dcafaf788236fe6d018388dd55d5bf9650ded696)

Conflicts:
	akka-docs/rst/java/lambda-persistence.rst
	akka-docs/rst/java/persistence.rst
	akka-docs/rst/scala/persistence.rst
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/main/scala/akka/persistence/View.scala
2014-06-26 10:10:09 +02:00
Patrik Nordwall
d6ffdf521c =per #15429 Rewrite persistence documentation and samples for 2.3.4 changes
(cherry picked from commit 02351e32f110a8c4a249f0f3f84bae5898d1a836)

Conflicts:
	akka-samples/akka-sample-persistence-java-lambda/tutorial/index.html
	akka-samples/akka-sample-persistence-java/tutorial/index.html
	akka-samples/akka-sample-persistence-scala/build.sbt
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ConversationRecoveryExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/PersistentActorExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ProcessorChannelExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/ProcessorChannelRemoteExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/SnapshotExample.scala
	akka-samples/akka-sample-persistence-scala/src/main/scala/sample/persistence/StreamExample.scala
	akka-samples/akka-sample-persistence-scala/tutorial/index.html
2014-06-25 15:37:35 +02:00
Konrad 'ktoso' Malawski
4bb321a83a !per #15230 rename processorId => persistentId
* This is NOT binary compatible, we're in an *experimental* module.
* disabled binary compat checks for package akka.persistence
* Source compatibility is retained, but users should migrate do the new
  method name ASAP.
* Plugin APIs were migrated in a way that allows the old plugins to
  compile agains 2.3.4 without having to change anything. Hopefuly this
  will help authors migrate to 2.3.4 sooner. This is only source level compatible, not binary compatible.
* added deprecation warnings on all processorId methods and provided bridges where possible
* for users, the migration should be painless, they can still override
  the old method, and it'll work. But we encourage them to move to
  persistenceId; All delegation code will have to be removed afterwards ofc.

Conflicts:
	akka-persistence/src/main/scala/akka/persistence/Channel.scala
	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/PersistentChannel.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	akka-persistence/src/main/scala/akka/persistence/Snapshot.scala
	akka-persistence/src/main/scala/akka/persistence/journal/AsyncWriteProxy.scala
	akka-persistence/src/main/scala/akka/persistence/journal/inmem/InmemJournal.scala
	akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbKey.scala
	akka-persistence/src/main/scala/akka/persistence/snapshot/SnapshotStore.scala
	akka-persistence/src/test/scala/akka/persistence/serialization/SerializerSpec.scala
	project/AkkaBuild.scala
2014-06-24 17:05:18 +02:00
Marcin Kubala
f4793a399f =act,clu,con,doc,per,rem,sam #15114 append missing parens at Actor.sender() invocations 2014-06-20 23:05:51 +02:00
Konrad 'ktoso' Malawski
a71790bb18 +per #15229 defer for PersistentActor
* Deferred events are not persisted, thus will not participate in replays
  etc. If users want events to be persisted, they can simply use
  `persistAsync` instead.
* This, 3rd, rewrite extends the Persistent hierarchy by a top level
  trait "Resequenceable", which is used to mark every event to be sent
  in sequence back to the PersistentActor. These are split into
  NonPersistentRepr or PersistentRepr, and acted upon accordingly.
* defer is guaranteed to be called, even after persistence failures
* Includes docs updates for java/scala/java8

Resolves #15229
Depends on #15227

Conflicts:
	akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	akka-persistence/src/test/scala/akka/persistence/PersistentActorSpec.scala
	project/AkkaBuild.scala
2014-06-10 17:09:24 +02:00
Björn Antonsson
9bcaeff87d +per #13944 Send RecoveryComplete message at end of recovery
Fixes #13944

Conflicts:
	akka-docs/rst/scala/code/docs/persistence/PersistenceDocSpec.scala
	akka-persistence/src/main/scala/akka/persistence/Processor.scala
	project/AkkaBuild.scala
2014-06-10 13:22:10 +02:00
Konrad 'ktoso' Malawski
d51b79c95a !per persistAsync
Breaks binary compatibility because adding new methods to Eventsourced
trait. Since akka-persistence is experimental this is ok, yet
source-level compatibility has been perserved thankfuly :-)

Deprecates:
* Rename of EventsourcedProcessor -> PersistentActor
* Processor -> suggest using PersistentActor
* Migration guide for akka-persistence is separate, as wel'll deprecate in minor versions (its experimental)
* Persistent as well as ConfirmablePersistent - since Processor, their
  main user will be removed soon.

Other changes:
* persistAsync works as expected when mixed with persist
* A counter must be kept for pending stashing invocations
* Uses only 1 shared list buffer for persit / persistAsync
* Includes small benchmark
* Docs also include info about not using Persistent() wrapper
* uses java LinkedList, for best performance of append / head on
  persistInvocations; the get(0) is safe, because these msgs only
  come in response to persistInvocations
* Renamed internal *MessagesSuccess/Failure messages because we kept
  small mistakes seeing the class "with s" and "without s" as the same
* Updated everything that refered to EventsourcedProcessor to
  PersistentActor, including samples

Refs #15227

Conflicts:
	akka-docs/rst/project/migration-guides.rst
	akka-persistence/src/main/scala/akka/persistence/JournalProtocol.scala
	akka-persistence/src/main/scala/akka/persistence/Persistent.scala
	akka-persistence/src/test/scala/akka/persistence/PersistentActorSpec.scala
	project/AkkaBuild.scala
2014-06-10 11:09:12 +02:00
Björn Antonsson
c8ea061472 =pro Update test dependencies to Scala 2.11 cross published versions 2014-04-23 13:58:38 +02:00
Patrik Nordwall
c1f7d7fa21 =doc #3924 Doc how to be notified when recovery completed 2014-03-25 10:46:05 +01:00
Adam Voss
cce29dfa51 Changes all occurances of Typesafe copyright to extend to 2014. 2014-02-04 21:20:09 -06:00
Patrik Nordwall
10fbdd2db8 Merge pull request #1939 from krasserm/wip-3828-rename-recreiveReplay-krasserm
!per #3828 Rename receiveReplay to receiveRecover
2014-01-20 02:53:51 -08:00
Martin Krasser
e0f5cf5f2c !per #3828 Rename receiveReplay to receiveRecover
- because it handles messages related to recovery (snapshots and replayed messages)
2014-01-19 17:46:32 +01:00
Patrik Nordwall
9eb32a4486 =act #3738 Fix memory leaks in tests
* afterAll not called when all tests marked as ignore,
  invokeBeforeAllAndAfterAllEvenIfNoTestsAreExpected = true
  should solve that, but changed to pending in Ticket1978 anyway
* Try to shutdown when ActorSystem init fails. It is difficult
  to cover all scenarios, but this should improve the situation.
  This was the reason why DeployerSpec leaked.
* missing shutdown in some tests
2014-01-17 16:18:35 +01:00
Martin Krasser
f327e1e357 !per #3704 Persistence improvements
- Channel enhancements (#3773):
- Live read models (#3776):
- Batch-oriented journal plugin API (#3804):
- Batching of confirmations and deletions
- Message deletion enhancements (more efficient range deletions)
2014-01-17 13:36:55 +01:00
Patrik Nordwall
5a019c0a7a =doc #3689 Don't rewrite arrows in doc and samples 2013-12-12 16:08:23 +01:00
Martin Krasser
4e5ce5529c !per #3761 Reliable channels
- Built-in redelivery mechanism for Channel and PersistentChannel
- redelivery counter on ConfirmablePersistent
- redeliveries out of initial message delivery order
- relative order of redelivered messages is preserved
- configurable redelivery policy (ChannelSettings)
- Major refactorings of channels (and channel tests)
- Throughput load test for PersistentChannel

Todo:

- Paged/throtlled replay (another pull request)
- Resequencer (another pull request)
2013-12-12 12:22:46 +01:00
Martin Krasser
d0bc8a6400 +per #3746 Remote sharing of LevelDB for testing purposes
Further changes

- remove obsolete identity checks in Eventsourced
- fix wrong serialize-messages config in tests
2013-12-03 08:51:25 +01:00
Martin Krasser
6e2f80bab0 !per #3729 Journaling protocol optimization
- internal batching of individually received Persistent messages
- testing fault tolerance of Processor in presence of random
  * journaling failures
  * processing failures
2013-11-27 13:51:27 +01:00
Martin Krasser
4489a72bea !per #3717 Deletion API for snapshots and persistent messages
- single and bulk deletion of messages
- single and bulk deletion of snapshots
- run journal and snapshot store as system actors
- rename physical parameter in delete methods to permanent
- StashSupport.prepend docs and implementation enhancements
2013-11-20 14:45:29 +01:00
Martin Krasser
ba9fc4da46 !per #3707 Channel enhancements
- Persistent channel
- ConfirmablePersistent message type delivered by channel
- Sender resolution performance improvements
   * unstash() instead of unstashAll()

These enhancements required the following changes

- Unified implementation of processor stash and user stash
- Persistence message plugin API separated from implementation
- Physical deletion of messages
2013-11-14 12:05:37 +01:00
Martin Krasser
1da3369643 !per #3681 Performance and consistency improvements
- batch-write of persistent messages (user API)
- batch-write of events (in EventsourcedProcessor)
- command processing in EventsourcedProcessor by unstashing messages one-by-one from the internal stash
   * fixes performance issues that come up with unstashAll
- commands are not looped through journal actor but processed directly
- initial performance tests
  * command sourcing
  * event sourcing
  * event sourcing with user stash operations
- suppress stack traces in tests
2013-10-30 15:08:15 +01:00
Martin Krasser
2a30399a29 !per #3652 Custom snapshot and persistent message serialization
- Protobuf serializer for Persistent message
- Configurable serializer for Persistent message's payload
- Configurable serializer for snapshots
2013-10-14 17:35:04 +02:00
Martin Krasser
da7490bbc9 +per #3641 Storage plugin API
- Journal plugin API for storage backends with asynchronous client API (default impl: in-memory journal)
- Journal plugin API for storage backends with synchronous client API (default impl: LevelDB journal)
- Snapshot store plugin API (default impl: local filesystem snapshot store)
2013-10-08 11:46:32 +02:00
Martin Krasser
842ac672f7 !per #3631 Snapshotting
- capture and save snapshots of processor state
- start processor recovery from saved snapshots
- snapshot storage on local filesystem
- snapshot store completely isolated from journal
- LevelDB journal modularized (and completely re-rwritten)
- In-memory journal removed
2013-09-30 17:31:08 +02:00
Martin Krasser
6c78629cdb !per #3618 Cleanup duplication of life cycle hooks in Processor
- introduce around life cycle hooks for symmetry with aroundReceive
 - no custom processor-specific life cycle hooks needed any more
 - preStart and preRestart can be overridden with empty implementation
    (interceptors ensure that super.preXxx calls are still executed)
 - all around life cycle hooks can be final
 - standard life cycle hooks are non-final to preserve composability with existing traits (FSM, ...)
2013-09-18 14:41:38 +02:00
Martin Krasser
cdeea924ff akka-persistence prototype
The most prominent changes compared to eventsourced are:

- No central processor and channel registry any more
- Auto-recovery of processors on start and restart (can be disabled)
- Recovery of processor networks doesn't require coordination
- Explicit channel activation not needed any more
- Message sequence numbers generated per processor (no gaps)
- Sender references are journaled along with messages
- Processors can determine their recovery status
- No custom API on extension object, only messages
- Journal created by extension from config, not by application
- Applications only interact with processors and channels via messages
- Internal design prepared for having processor-specific journal actors (for later optimization possibilities)

Further additions and changes during review:

- Allow processor implementation classes to use inherited stash
- Channel support to resolve (potentially invalid) sender references
- Logical intead of physical deletion of messages
- Pinned dispatcher for LevelDB journal
- Processor can handle failures during recovery
- Message renamed to Persistent

This prototype has the following limitations:

- Serialization of persistent messages and their payload via JavaSerializer only (will be configurable later)
- The LevelDB journal implementation based on a LevelDB Java port, not the native LevelDB (will be configurable later)

The following features will be added later using separate tickets:

- Snapshot-based recovery
- Reliable channels
- Journal plugin API
- Optimizations
- ...
2013-09-14 14:19:38 +02:00