meilisearch / MeiliES

A Rust based event store using the Redis protocol
MIT License
324 stars 20 forks source link

ReadFrom does not list all events from some particular point in time #48

Open maarek opened 4 years ago

maarek commented 4 years ago

When subscribing to a stream with only from defined, meilies seems to only read the event at the from location and then all new events. It does not read all events starting from the from value.

$ meilies-cli publish 'my-little-stream' 'my-event-two' '0' 
$ meilies-cli publish 'my-little-stream' 'my-event-two' '1'
$ meilies-cli publish 'my-little-stream' 'my-event-two' '2'  
$ meilies-cli subscribe 'my-little-stream:0'
Subscribed { stream: StreamName("my-little-stream") }
Event { stream: StreamName("my-little-stream"), number: EventNumber(0), event_name: EventName("my-event-two"), event_data: EventData("0") }

From my understanding, events are keyed by event number and ReadRange::ReadFrom(from) uses tree.scan_prefix(_) which in the case of from being 0 only 1 event is keyed with 0. Is this this right? Is this the intended result?

Kerollmops commented 4 years ago

Hum, you are right, it seems like a bug, when specifying the range from value the client must see every events starting from the left bound and all the new events.

Unfortunately I don't think I will have time to look into this bug for now.

Thank you for your report anyway, if you have time to look into that it would be pretty cool :)