Deprecate LevelDB (#30213)
* Deprecate LevelDB In preparation of moving into the testing infra (or deleting it completely) at some distant future point in time * Remove leveldb tests where there also is an inmem one * More details in deprecation text, recommend inmem + journal proxy for testing etc.
This commit is contained in:
parent
1c6f184127
commit
d4fdf5639e
33 changed files with 79 additions and 490 deletions
|
|
@ -68,7 +68,10 @@ This plugin writes events to a local LevelDB instance.
|
|||
|
||||
@@@ warning
|
||||
The LevelDB plugin cannot be used in an Akka Cluster since the storage is in a local file system.
|
||||
@@@
|
||||
@@@
|
||||
|
||||
The LevelDB journal is deprecated and it is not advised to build new applications with it.
|
||||
As a replacement we recommend using [Akka Persistence JDBC](https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html).
|
||||
|
||||
The LevelDB journal plugin config entry is `akka.persistence.journal.leveldb`. Enable this plugin by
|
||||
defining config property:
|
||||
|
|
@ -99,14 +102,8 @@ this end, LevelDB offers a special journal compaction function that is exposed v
|
|||
|
||||
### Shared LevelDB journal
|
||||
|
||||
For testing purposes a LevelDB instance can also be shared by multiple actor systems (on the same or on different nodes). This, for
|
||||
example, allows persistent actors to failover to a backup node and continue using the shared journal instance from the
|
||||
backup node.
|
||||
|
||||
@@@ warning
|
||||
A shared LevelDB instance is a single point of failure and should therefore only be used for testing
|
||||
purposes.
|
||||
@@@
|
||||
The LevelDB journal is deprecated and will be removed from a future Akka version, it is not advised to build new
|
||||
applications with it. For testing in a multi node environment the "inmem" journal together with the @ref[proxy plugin](#persistence-plugin-proxy) can be used, but the actual journal used in production of applications is also a good choice.
|
||||
|
||||
@@@ note
|
||||
This plugin has been supplanted by @ref:[Persistence Plugin Proxy](#persistence-plugin-proxy).
|
||||
|
|
@ -165,20 +162,21 @@ you don't have to configure it.
|
|||
|
||||
### Persistence Plugin Proxy
|
||||
|
||||
For testing purposes a persistence plugin proxy allows sharing of journals and snapshot stores across multiple actor systems (on the same or
|
||||
on different nodes). This, for example, allows persistent actors to failover to a backup node and continue using the
|
||||
shared journal instance from the backup node. The proxy works by forwarding all the journal/snapshot store messages to a
|
||||
single, shared, persistence plugin instance, and therefore supports any use case supported by the proxied plugin.
|
||||
For testing purposes a persistence plugin proxy allows sharing of a journal and snapshot store on a single node across multiple
|
||||
actor systems (on the same or on different nodes). This, for example, allows persistent actors to failover to a backup
|
||||
node and continue using the shared journal instance from the backup node. The proxy works by forwarding all the
|
||||
journal/snapshot store messages to a single, shared, persistence plugin instance, and therefore supports any use case
|
||||
supported by the proxied plugin.
|
||||
|
||||
@@@ warning
|
||||
A shared journal/snapshot store is a single point of failure and should therefore only be used for testing
|
||||
A shared journal/snapshot store is a single point of failure and should only be used for testing
|
||||
purposes.
|
||||
@@@
|
||||
|
||||
The journal and snapshot store proxies are controlled via the `akka.persistence.journal.proxy` and
|
||||
`akka.persistence.snapshot-store.proxy` configuration entries, respectively. Set the `target-journal-plugin` or
|
||||
`target-snapshot-store-plugin` keys to the underlying plugin you wish to use (for example:
|
||||
`akka.persistence.journal.leveldb`). The `start-target-journal` and `start-target-snapshot-store` keys should be
|
||||
`akka.persistence.journal.inmem`). The `start-target-journal` and `start-target-snapshot-store` keys should be
|
||||
set to `on` in exactly one actor system - this is the system that will instantiate the shared persistence plugin.
|
||||
Next, the proxy needs to be told how to find the shared plugin. This can be done by setting the `target-journal-address`
|
||||
and `target-snapshot-store-address` configuration keys, or programmatically by calling the
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
# Persistence Query for LevelDB
|
||||
|
||||
The LevelDB journal and query plugin is deprecated and it is not advised to build new applications with it.
|
||||
As a replacement we recommend using [Akka Persistence JDBC](https://doc.akka.io/docs/akka-persistence-jdbc/current/index.html).
|
||||
|
||||
## Dependency
|
||||
|
||||
To use Persistence Query, you must add the following dependency in your project:
|
||||
|
|
|
|||
|
|
@ -266,8 +266,6 @@ used the next time this projection is started. This pattern is implemented in th
|
|||
Query plugins are various (mostly community driven) `ReadJournal` implementations for all kinds
|
||||
of available datastores. The complete list of available plugins is maintained on the Akka Persistence Query [Community Plugins](https://akka.io/community/#plugins-to-akka-persistence-query) page.
|
||||
|
||||
The plugin for LevelDB is described in @ref:[Persistence Query for LevelDB](persistence-query-leveldb.md).
|
||||
|
||||
This section aims to provide tips and guide plugin developers through implementing a custom query plugin.
|
||||
Most users will not need to implement journals themselves, except if targeting a not yet supported datastore.
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ recover its state from these messages.
|
|||
case of sender and receiver JVM crashes.
|
||||
* `AsyncWriteJournal`: A journal stores the sequence of messages sent to a persistent actor. An application can control which messages
|
||||
are journaled and which are received by the persistent actor without being journaled. Journal maintains `highestSequenceNr` that is increased on each message.
|
||||
The storage backend of a journal is pluggable. The persistence extension comes with a "leveldb" journal plugin, which writes to the local filesystem.
|
||||
The storage backend of a journal is pluggable.
|
||||
Replicated journals are available as [Community plugins](https://akka.io/community/).
|
||||
* *Snapshot store*: A snapshot store persists snapshots of a persistent actor's state. Snapshots are
|
||||
used for optimizing recovery times. The storage backend of a snapshot store is pluggable.
|
||||
|
|
@ -828,6 +828,10 @@ For more advanced schema evolution techniques refer to the @ref:[Persistence - S
|
|||
|
||||
## Testing with LevelDB journal
|
||||
|
||||
The LevelDB journal is deprecated and will be removed from a future Akka version, it is not advised to build new applications
|
||||
with it. For testing the built in "inmem" journal or the actual journal that will be used in production of the application
|
||||
is recommended. See @ref[Persistence Plugins](persistence-plugins.md) for some journal implementation choices.
|
||||
|
||||
When running tests with LevelDB default settings in `sbt`, make sure to set `fork := true` in your sbt project. Otherwise, you'll see an `UnsatisfiedLinkError`. Alternatively, you can switch to a LevelDB Java port by setting
|
||||
|
||||
@@snip [PersistencePluginDocSpec.scala](/akka-docs/src/test/scala/docs/persistence/PersistencePluginDocSpec.scala) { #native-config }
|
||||
|
|
@ -836,9 +840,7 @@ or
|
|||
|
||||
@@snip [PersistencePluginDocSpec.scala](/akka-docs/src/test/scala/docs/persistence/PersistencePluginDocSpec.scala) { #shared-store-native-config }
|
||||
|
||||
in your Akka configuration. The LevelDB Java port is for testing purposes only.
|
||||
|
||||
Also note that for the LevelDB Java port, you will need the following dependencies:
|
||||
in your Akka configuration. Also note that for the LevelDB Java port, you will need the following dependencies:
|
||||
|
||||
@@dependency[sbt,Maven,Gradle] {
|
||||
group="org.iq80.leveldb"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue