diff --git a/akka-docs/rst/java/lambda-persistence.rst b/akka-docs/rst/java/lambda-persistence.rst index 30aa9ab83f..346d08736d 100644 --- a/akka-docs/rst/java/lambda-persistence.rst +++ b/akka-docs/rst/java/lambda-persistence.rst @@ -362,11 +362,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail. +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. | | | +-------------------------------+-----------------------------------+ -| | | ``onPersistRejected`` | --- | +| | | ``onPersistRejected`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``recovery`` | ``RecoverySuccess`` | ``onRecoveryFailure`` | Actor is stopped. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ -| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- | +| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which @@ -488,9 +488,25 @@ saved snapshot matches the specified ``SnapshotSelectionCriteria`` will replay a Snapshot deletion ----------------- -A persistent actor can delete individual snapshots by calling the ``deleteSnapshot`` method with the sequence number and the -timestamp of a snapshot as argument. To bulk-delete snapshots matching ``SnapshotSelectionCriteria``, persistent actors should -use the ``deleteSnapshots`` method. +A persistent actor can delete individual snapshots by calling the ``deleteSnapshot`` method with the sequence number of +when the snapshot was taken. + +To bulk-delete a range of snapshots matching ``SnapshotSelectionCriteria``, +persistent actors should use the ``deleteSnapshots`` method. + +Snapshot status handling +------------------------ + +Saving or deleting snapshots can either succeed or fail – this information is reported back to the persistent actor via +status messages as illustrated in the following table. + +============================================== ========================== ============================== +**Method** **Success** **Failure message** +============================================== ========================== ============================== +``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure`` +``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure`` +``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure`` +============================================== ========================== ============================== .. _at-least-once-delivery-java-lambda: diff --git a/akka-docs/rst/java/persistence.rst b/akka-docs/rst/java/persistence.rst index 1db0257c0b..a1e69ee8e4 100644 --- a/akka-docs/rst/java/persistence.rst +++ b/akka-docs/rst/java/persistence.rst @@ -365,11 +365,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail. +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. | | | +-------------------------------+-----------------------------------+ -| | | ``onPersistRejected`` | --- | +| | | ``onPersistRejected`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``recovery`` | ``RecoverySuccess`` | ``onRecoveryFailure`` | Actor is stopped. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ -| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- | +| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which @@ -497,6 +497,20 @@ when the snapshot was taken. To bulk-delete a range of snapshots matching ``SnapshotSelectionCriteria``, persistent actors should use the ``deleteSnapshots`` method. +Snapshot status handling +------------------------ + +Saving or deleting snapshots can either succeed or fail – this information is reported back to the persistent actor via +status messages as illustrated in the following table. + +============================================== ========================== ============================== +**Method** **Success** **Failure message** +============================================== ========================== ============================== +``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure`` +``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure`` +``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure`` +============================================== ========================== ============================== + .. _at-least-once-delivery-java: At-Least-Once Delivery diff --git a/akka-docs/rst/scala/persistence.rst b/akka-docs/rst/scala/persistence.rst index ed9abd8190..34c880e020 100644 --- a/akka-docs/rst/scala/persistence.rst +++ b/akka-docs/rst/scala/persistence.rst @@ -353,11 +353,11 @@ Persisting, deleting and replaying messages can eitehr succeed or fail. +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``persist`` / ``persistAsync`` | persist handler invoked | ``onPersistFailure`` | Actor is stopped. | | | +-------------------------------+-----------------------------------+ -| | | ``onPersistRejected`` | --- | +| | | ``onPersistRejected`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ | ``recovery`` | ``RecoveryCompleted`` | ``onRecoveryFailure`` | Actor is stopped. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ -| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | --- | +| ``deleteMessages`` | ``DeleteMessagesSuccess`` | ``DeleteMessagesFailure`` | No automatic actions. | +---------------------------------+-----------------------------+-------------------------------+-----------------------------------+ The most important operations (``persist`` and ``recovery``) have failure handlers modelled as explicit callbacks which @@ -499,14 +499,14 @@ status messages as illustrated in the following table. ============================================== ========================== ============================== **Method** **Success** **Failure message** ============================================== ========================== ============================== -``saveSnapshot`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure`` +``saveSnapshot(Any)`` ``SaveSnapshotSuccess`` ``SaveSnapshotFailure`` ``deleteSnapshot(Long)`` ``DeleteSnapshotSuccess`` ``DeleteSnapshotFailure`` ``deleteSnapshots(SnapshotSelectionCriteria)`` ``DeleteSnapshotsSuccess`` ``DeleteSnapshotsFailure`` ============================================== ========================== ============================== If failure messages are left unhandled by the actor, a default warning log message will be logged for each incoming failure message. No default action is performed on the success messages, however you're free to handle them e.g. in order to delete -an in memory representation of the snapshot, or in the case of failure to attempt save the snapshot aggain. +an in memory representation of the snapshot, or in the case of failure to attempt save the snapshot again. .. _at-least-once-delivery: diff --git a/akka-persistence-tck/src/main/scala/akka/persistence/journal/JournalSpec.scala b/akka-persistence-tck/src/main/scala/akka/persistence/journal/JournalSpec.scala index 72900b1e7a..90c3c320c2 100644 --- a/akka-persistence-tck/src/main/scala/akka/persistence/journal/JournalSpec.scala +++ b/akka-persistence-tck/src/main/scala/akka/persistence/journal/JournalSpec.scala @@ -149,6 +149,7 @@ abstract class JournalSpec(config: Config) extends PluginSpec(config) { subscribe[DeleteMessagesTo](sub.ref) journal ! cmd sub.expectMsg(cmd) + receiverProbe2.expectMsg(DeleteMessagesSuccess(cmd.toSequenceNr)) journal ! ReplayMessages(1, Long.MaxValue, Long.MaxValue, pid, receiverProbe.ref) List(4, 5) foreach { i ⇒ receiverProbe.expectMsg(replayedMessage(i)) } diff --git a/project/ValidatePullRequest.scala b/project/ValidatePullRequest.scala index 93b7915012..5066fd1f3e 100644 --- a/project/ValidatePullRequest.scala +++ b/project/ValidatePullRequest.scala @@ -106,10 +106,10 @@ object ValidatePullRequest extends AutoPlugin { // if this project depends on a modified module, we must test it deps.nodes.exists { m => - val depends = modifiedModuleIds exists { - _.name == m.id.name - } // match just by name, we'd rather include too much than too little - if (depends) log.info(s"Project [$name] must be verified, because depends on [${modifiedModuleIds.find(_ == m.id).get}]") + // match just by name, we'd rather include too much than too little + val dependsOnModule = modifiedModuleIds find { _.name == m.id.name } + val depends = dependsOnModule.isDefined + if (depends) log.info(s"Project [$name] must be verified, because depends on [$dependsOnModule]") depends } }