I’ve tried Real Redis MASTER and 1 my Redis As SLAVE.
When I sent WAIT 10 300 to the MASTER without any WRITEs before I’ve got:
[‘REPLCONF’, ‘GETACK’, ‘*’]
on SLAVE and everything works fine.
Then I’ve tried my Redis as MASTER and 1 Real Redis SLAVE.
When I sent WAIT 10 300 to the MASTER without any WRITEs before I’ve got
the additional [‘REPLCONF’, ‘ACK’, ‘185’] from SLAVE
and everything works fine.
But on tests I’ve sent:
[‘REPLCONF’, ‘GETACK’, ‘*’] to all test replicas and did not get any ACK answer
Here are my logs:
remote: [replication-17] client: $ redis-cli WAIT 3 500
remote: [your_program] ['WAIT', '3', '500']
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] R <- b'*3\r\n$8\r\nREPLCONF\r\n$6\r\nGETACK\r\n$1\r\n*\r\n'
remote: [your_program] [Start WAIT] at 1712997390.1653676
remote: [your_program] [STOP WAIT] at 1712997390.6666832
remote: [your_program] <- b':0\r\n'
Can you try setting debug: true in your codecrafters.yml? I think you should see more helpful logs in that case. We should be logging out the reciept of GETACK *, and the ACKs that were sent back.
I am also running into the same issue. Setting debug: true in the config file shows that the test replica does not respond to the getack commands that I send as the connection is reset. Are there any solutions on my end to this problem?
In test for the Replication-17 step your replicas are not going to get:
REPLCONF GETACK *
when master get WAIT cmd.
and this is described in Replication-17 step.
It is clear and there would not be a problem if real REDIS behaves in the same way. But it is not. Real REDIS sends REPLCONF GETACK * in all cases, even if it empty.
@gnomeby our behaviour should match what Redis does. We verify our tester against an official Redis server for this very purpose. Can you share more details on the differences you’re seeing? Are you able to observe this locally?
Case 1:
Official empty Redis as MASTER
and 1 my redis as slave
if I send WAIT 1 1 to master then MASTER responses immediately without sending REPLCONF GETACK * to SLAVE.
if I send WAIT 2 1 (more replicas then exists) to master then MASTER sends REPLCONF GETACK * to SLAVEs.
For anyone else who lands here, you can confirm this with wireshark. Spawn a Redis master and connect as a replica, you’ll see that it doesn’t request ACKs if no commands are sent and the replica count is lesser than / equal to the connected count:
Note: I’ve updated the title of this post to include the stage ID (#TU8). You can learn about the stages rename here: Upcoming change: Stages overhaul.