Strange tester error in Redis challenge #NA2

I’m stuck on Stage #NA2 of the Redis challenge.

My implementation works locally, but I got a pretty non-sensical error from the tester after 1 successful test case. The error says I’m not propagating a SET, but the logs show that my server Is propagating them:

[tester::#NA2] Running tests for Stage #NA2 (Replication - WAIT with multiple commands)
[tester::#NA2] $ ./your_program.sh --port 6379
[tester::#NA2] Proceeding to create 3 replicas.
[tester::#NA2] [setup] Creating 3 replicas:
[tester::#NA2] [setup] 1. replica@6380 (Listening port = 6380)
[tester::#NA2] [setup] 2. replica@6381 (Listening port = 6381)
[tester::#NA2] [setup] 3. replica@6382 (Listening port = 6382)
[your_program] server started
[your_program] accepted client client.Client@787a1e300000 [conns = 1]
[tester::#NA2] [handshake] [replica@6380] $ redis-cli PING
[tester::#NA2] [handshake] [replica@6380] ✔︎ Received "PONG"
[tester::#NA2] [handshake] [replica@6380] > REPLCONF listening-port 6380
[tester::#NA2] [handshake] [replica@6380] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6380] > REPLCONF capa psync2
[tester::#NA2] [handshake] [replica@6380] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6380] > PSYNC ? -1
[tester::#NA2] [handshake] [replica@6380] ✔︎ Received "FULLRESYNC 5bc0b6da7c7986c6df12e58fc3a17cc597df6c23 0"
[tester::#NA2] [handshake] [replica@6380] Received RDB file
[tester::#NA2] [handshake] [replica@6381] $ redis-cli PING
[tester::#NA2] [handshake] [replica@6381] ✔︎ Received "PONG"
[tester::#NA2] [handshake] [replica@6381] > REPLCONF listening-port 6381
[tester::#NA2] [handshake] [replica@6381] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6381] > REPLCONF capa psync2
[your_program] accepted client client.Client@787a1e300400 [conns = 2]
[tester::#NA2] [handshake] [replica@6381] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6381] > PSYNC ? -1
[tester::#NA2] [handshake] [replica@6381] ✔︎ Received "FULLRESYNC 5bc0b6da7c7986c6df12e58fc3a17cc597df6c23 0"
[tester::#NA2] [handshake] [replica@6381] Received RDB file
[tester::#NA2] [handshake] [replica@6382] $ redis-cli PING
[your_program] accepted client client.Client@787a1e300800 [conns = 3]
[tester::#NA2] [handshake] [replica@6382] ✔︎ Received "PONG"
[tester::#NA2] [handshake] [replica@6382] > REPLCONF listening-port 6382
[tester::#NA2] [handshake] [replica@6382] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6382] > REPLCONF capa psync2
[tester::#NA2] [handshake] [replica@6382] ✔︎ Received "OK"
[tester::#NA2] [handshake] [replica@6382] > PSYNC ? -1
[tester::#NA2] [handshake] [replica@6382] ✔︎ Received "FULLRESYNC 5bc0b6da7c7986c6df12e58fc3a17cc597df6c23 0"
[tester::#NA2] [handshake] [replica@6382] Received RDB file
[tester::#NA2] [test] [client] $ redis-cli SET foo 123
[your_program] accepted client client.Client@787a1e300c00 [conns = 4]
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] foo
[your_program] $3
[your_program] 123
[your_program]  to client.Client@787a1e300000
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] foo
[your_program] $3
[your_program] 123
[your_program]  to client.Client@787a1e300400
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] foo
[your_program] $3
[your_program] 123
[your_program]  to client.Client@787a1e300800
[tester::#NA2] [test] [client] ✔︎ Received "OK"
[tester::#NA2] [test] [client] > WAIT 1 500
[tester::#NA2] [test] Testing Replica: replica@6380
[tester::#NA2] [test] [replica@6380] Expecting "SET foo 123" to be propagated
[your_program] sending GETACK to client client.Client@787a1e300000 (ack = 0, broadcasted = 31)
[your_program] sending GETACK to client client.Client@787a1e300400 (ack = 0, broadcasted = 31)
[your_program] sending GETACK to client client.Client@787a1e300800 (ack = 0, broadcasted = 31)
[tester::#NA2] [test] [replica@6380] ✔︎ Received ["SET", "foo", "123"]
[tester::#NA2] [test] [replica@6380] Expecting "REPLCONF GETACK *" from Master
[tester::#NA2] [test] [replica@6380] ✔︎ Received ["REPLCONF", "GETACK", "*"]
[tester::#NA2] [test] [replica@6380] > REPLCONF ACK 31
[tester::#NA2] [test] Testing Replica: replica@6381
[tester::#NA2] [test] [replica@6381] Expecting "SET foo 123" to be propagated
[tester::#NA2] [test] [replica@6381] ✔︎ Received ["SET", "foo", "123"]
[tester::#NA2] [test] [replica@6381] Expecting "REPLCONF GETACK *" from Master
[tester::#NA2] [test] [replica@6381] ✔︎ Received ["REPLCONF", "GETACK", "*"]
[tester::#NA2] [test] Testing Replica: replica@6382
[tester::#NA2] [test] [replica@6382] Expecting "SET foo 123" to be propagated
[tester::#NA2] [test] [replica@6382] ✔︎ Received ["SET", "foo", "123"]
[tester::#NA2] [test] [replica@6382] Expecting "REPLCONF GETACK *" from Master
[tester::#NA2] [test] [replica@6382] ✔︎ Received ["REPLCONF", "GETACK", "*"]
[tester::#NA2] [test] Passed first WAIT test.
[tester::#NA2] [test] [client] > SET baz 789
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] baz
[your_program] $3
[your_program] 789
[your_program]  to client.Client@787a1e300000
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] baz
[your_program] $3
[your_program] 789
[your_program]  to client.Client@787a1e300400
[your_program] Sending *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] baz
[your_program] $3
[your_program] 789
[your_program]  to client.Client@787a1e300800
[tester::#NA2] [test] [client] ✔︎ Received "OK"
[tester::#NA2] [test] [client] > WAIT 3 2000
[tester::#NA2] [test] Testing Replica: replica@6380
[tester::#NA2] [test] [replica@6380] Expecting "SET baz 789" to be propagated
[tester::#NA2] Expected array, found simple string
[tester::#NA2] Test failed

Am I sending the propagation too early? Even in that case, they will be in the replicas read buffers for later consumption. At any rate, I don’t see why I’m failing the tests :frowning:

Nvm, found the error. I was not returning from the REPLCONF handler in case of a ACK, falling through the handshake cases, where the handler returns OK. So the replica servers were seeing an OK simple string before getting the SET propagations.

Apologies for the spurious message.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.