codecrafters-io / build-your-own-redis

Definition for the redis challenge.
https://app.codecrafters.io/courses/redis/overview
MIT License
129 stars 37 forks source link

WAIT with no commands has logical issues with testing #141

Closed youngk1019 closed 6 months ago

youngk1019 commented 7 months ago

For testing the WAIT command: WAIT numreplicas timeout, when the number of numreplicas is reached, it can be returned, and any value from numreplicas to the maximum number of replicas is possible. However, the testing task requires reaching the maximum number of replicas to consider it the correct testing logic. Specific command information can be viewed at this website address:https://redis.io/commands/wait/

linear[bot] commented 7 months ago

CC-1071 WAIT with no commands has logical issues with testing

rohitpaulk commented 6 months ago

Hey @youngk1019, thanks for reporting this. I think our expectation here adheres to the Redis spec:

Since WAIT returns the number of replicas reached both in case of failure and success, the client should check that the returned value is equal or greater to the replication level it demanded.

We run our tester against the official Redis implementation periodically to avoid bugs of this nature.

Feel free to re-open if you still think there's a mistake here!