alicebob / miniredis

Pure Go Redis server for Go unittests
MIT License
3.09k stars 215 forks source link

Fix Stream Lag and Add EntriesAdded/EntriesRead #377

Open sancar opened 5 months ago

sancar commented 5 months ago

Added them according to redis spec described here https://redis.io/docs/latest/commands/xinfo-groups/

alicebob commented 5 months ago

On Thu, Jun 06, 2024 at 06:57:54AM -0700, sancar wrote:

Added them according to redis spec described here

Thanks for the PR!, I'll have a look soon.

sancar commented 5 months ago

@alicebob I realized that there are some behavior differences with Redis. entries-read sometimes should be Nil instead of zero. I will update the pr shortly.

alicebob commented 5 months ago

On Thu, Jun 06, 2024 at 11:31:00PM -0700, sancar wrote:

@alicebob I realized that there are some behavior differences with Redis. entries-read sometimes should be Nil instead of zero. I will update the pr shortly.

Thanks! The tests in ./integration might help, they compare mini with real.

sancar commented 5 months ago

@alicebob The problem is that redis is not behaving according to spec, if I am not getting it wrong :) See especially TestStreamDelete . The test as it is follows spec. The redis implementation(7.2.3) expects it to be like this ~https://gist.github.com/sancar/a20791cfaa7998974593e63445a1325f~ == EDIT== I have deleted the gist but added the same thing to your integration tests. I think, it shows the problem much better.

Which one is your preference redis implementation or redis spec for miniredis ?

alicebob commented 5 months ago

Which one is your preference redis implementation or redis spec for miniredis ?

Redis, 100% :)

sancar commented 5 months ago

Dear @alicebob,

I was really happy with our relationship. It was working out smoothly so far. It's hard for me to say this, but it seems like this is the end of our relationship. It's not about you; it's about Redis.

From this point forward, I'll have to fork miniredis and continue alone.

I've added integration tests to demonstrate the disparities between Redis's specifications and its actual behavior. I plan to report this to Redis as a bug. If someday the planets align perfectly (Redis fixes the bug, MiniRedis adjusts its tests), then perhaps we can get together.

I'm uncertain about what to do with this pull request. Honestly, I'm not keen on trying to understand and implement buggy behavior.

Sincerely, @sancar from Upstash.

alicebob commented 5 months ago

I'm uncertain about what to do with this pull request. Honestly, I'm not keen on trying to understand and implement buggy behavior.

I consider the documentation to be buggy then :) I haven't really looked at this issue, which will take me a few days, but /generally/ the goal of miniredis is "do as Redis does".

sancar commented 5 months ago

I think you will consider the doc correct but implementation buggy after spending some time on it. I will follow this thread to get your ideas as well.

alicebob commented 5 months ago

I think you will consider the doc correct but implementation buggy after spending some time on it.

That does indeed align with my experience with Redis :)

I will follow this thread to get your ideas as well.

Okay, thanks!

alicebob commented 5 months ago

Hi, started looking at this today, but figuring out what Redis is up to took long and I couldn't finish that today. Just heads up I haven't forgotten :)

sancar commented 5 months ago

Hi @alicebob , I think we can wait a bit for these to be clarified. https://github.com/redis/redis/issues/13337 https://github.com/redis/redis/pull/13338