Hard deleted stream


I am trying to reuse a hard deleted stream. The stream has an id with a fixed GUID. I have started evenstore using unsafe-ignore-hard-delete=true. I’ve run a scavenge. But I still get a EventStore.ClientAPI.Exceptions.StreamDeletedException when trying to append to the hard deleted/scavenged stream. I thought the setting would allow a client to write to deleted streams?

Seems like a weird thing to do? It is an instance stream, containing tenant events. It’s stream id is a hard coded convention. I have polluted some events with corrupated metadata. Now I want to hard delete the stream and add them again. Soft deleting causes a concurrency issue with the EventFlow framework which we use.

Kind regards

Hard deletion tombstones the stream and prevents it from being recreated. In order to delete a stream with intention to be able to write to it later, you need to soft-delete it.

It’s actually reasonably well-documented.

Thanks for the quick reply. Than what does the below text from your webiste mean?

*When you [delete a stream]

failing on a hard deleted stream

You can override this behaviour and tell EventStoreDB that you want to delete all the traces of hard-deleted streams too, using the option specified below. After a scavenge operation runs, all hard-deleted streams will be open for writing new events again.

| — | — |
…–unsafe-ignore-hard-delete...* ***Default** : false`

Setting this option to true disables hard deletes and allows clients to write to deleted streams. For that reason, the option is considered unsafe and should be used with caution.

Ok, I am sorry for the confusion as you already have the option set and run the scavenge.

Do you have a single node or a cluster? If you use a cluster, did you scavenge all the nodes? Scavenging is a node-specific operation, scavenging one node of the cluster doesn’t do anything to other nodes.

It’s a single node. It is all happening in the latest/active chunk. Could that be the cause?

It might be, I think. I am not even sure if the active chunk can be scavenged as doing such would severely decrease the server performance and overall introduce a lot of complexity.

Just confirmed that the active chunk won’t be scavenged.