Skip to main content

Command: EDelete

Deletes a key with ephemeral durability, for example to drop a cache entry or end a session before it expires. Ephemeral keys live only in the partition leader's memory and are lost on a node restart or a leader change; see Durability Levels. The key is ignored if it doesn't exist. For persistent keys, use delete.

Syntax​

edelete <key>
edel <key>

edel is a short form of edelete; both behave the same.

Examples​

eset `cache_server_dev` '10.1.1.22:9090'
r0 set 9ms
edelete `cache_server_dev`
r1 deleted 12ms
eset `cache_server_dev` '10.1.1.24:9090'
r2 set 9ms

Checking the Result​

Use if not deleted then ... end to test whether the last delete found no key. not set also treats a successful delete as a write that took effect. Deleting a key that never existed writes no tombstone, even if the transaction locked it. Within a transaction, set-then-delete deletes the staged value; deleting it again finds no key. See Statement-Result Guards.

Notes​

A deleted ephemeral key is only marked as deleted; it stays in memory until the eviction process runs.

The delete tombstone is its own revision, so the key's revision history continues: in the example above, the eset after the delete returns r2. The history is kept only until the memory is reclaimed.