What happens when you delete a stream

donor-12345 has asked us to remove their data on the force of GDPR

so, I guess it makes sense that we should delete that stream.

What happens to the projections, as far as versionInStream? Do we wind up with gaps (versionInStream:4, versionInStream: 8, versionInStream: 9 etc.), in which case my application level subscription is still pointing to the last number, or will 10 events deleted cause the last event number to go down by 10.

Is my question unclear? Let me know if there’s something I could clarify.

I’m just under a lot of pressure because the higher ups want us to handle this GDPR request. Any help appreciated.

So just to make sure I understand your problem, I did this small example on an Eventstore.

  1. Create a stream with 10 events.

  2. Made a query to count the events:

    fromStream(‘example-1’)
    .when({
    $init:function(s,e){
    return {count :0}
    },
    $any:function(s,e){
    s.count++;
    }
    })

I got 10

  1. I truncate the stream below 5
  2. Ran the query again and I got 5.

Does that help, or do I not understand?

Not quite sure what you mean by truncate below 5?

Let’s say I have 3 streams

donor-1
DonorCreated
PledgeAdded
donor-2
DonorCreated
PledgeAdded
donor-3
DonorCreated
PledgeAdded

so in $ce-donor I have 6 event
DonorCreated (donor 1, versionInStream 1)
PledgeAdded (donor 1, versionInStream 2)
DonorCreated (donor 2, versionInStream 3)
PledgeAdded (donor 2, versionInStream 4)
DonorCreated (donor 3, versionInStream 5)
PledgeAdded (donor 3, versionInStream 6)

now I delete the donor-2 stream. What does $ce-donor look like:

DonorCreated (donor 1, versionInStream 1)
PledgeAdded (donor 1, versionInStream 2)
DonorCreated (donor 3, versionInStream 5)
PledgeAdded (donor 3, versionInStream 6)

or

DonorCreated (donor 1, versionInStream 1)
PledgeAdded (donor 1, versionInStream 2)
DonorCreated (donor 3, versionInStream 3)
PledgeAdded (donor 3, versionInStream 4)

The first alternative. SequenceNumber is always increasing, or catchup subscription would be impossible.

1 Like

Ok that’s what I was wondering. I wanted to make sure that when I deleted the stream, I don’t mess up my subscriptions. I suppose I could have verified this myself on a test instance, but wanted to know if anybody knew the answer off hand.

Thanks.