Command processing stage

I’m stuck on the commnad processing stage .

I’ve tried creating a new thread for the replica to process command independent of the master.

While , out of the three get commands the first two work as it should but the third command gets a null string . I cannot seem to understand why the replica is unable to process the third set command

Here are my logs:

client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received: +FULLRESYNC 75cd7bc10c49047e0d163660f3b90625b1af31dc 0
[your_program] x�ώ
[your_program] Waiting for a client to connect...
[your_program] Received: $88
[your_program] REDIS0011�	redis-ver7.2.0�
[your_program] redis-bits�@�ctime�m�e�used-mem°�
[your_program] Client connected
[your_program] Received: *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] foo
[your_program] $3
[your_program] 123
[your_program] �
[your_program] redis-bits�@�ctime�m�e�used-mem°�
[your_program] Received: *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] bar
[your_program] $3
[your_program] 456
[your_program] *3
[your_program] $3
[your_program] SET
[your_program] $3
[your_program] baz
[your_program] $3
[your_program] 789
[your_program] d-mem°�
[your_program] Received: *2
[your_program] $3
[your_program] GET
[your_program] $3
[your_program] foo
[your_program] 
[tester::#YG4] client: Received bytes: "$3\r\n123\r\n"
[tester::#YG4] client: Received RESP value: "123"
[tester::#YG4] Received "123"
[tester::#YG4] Getting key bar
[tester::#YG4] client: $ redis-cli GET bar
[tester::#YG4] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nbar\r\n"
[your_program] Received: *2
[your_program] $3
[your_program] GET
[your_program] $3
[your_program] bar
[your_program] 
[tester::#YG4] client: Received bytes: "$3\r\n456\r\n"
[tester::#YG4] client: Received RESP value: "456"
[tester::#YG4] Received "456"
[tester::#YG4] Getting key baz
[tester::#YG4] client: $ redis-cli GET baz
[tester::#YG4] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nbaz\r\n"
[your_program] Received: *2
[your_program] $3
[your_program] GET
[your_program] $3
[your_program] baz
[your_program] 
[tester::#YG4] client: Received bytes: "$-1\r\n"
[tester::#YG4] client: Received RESP value: NIL

link to my repo

the problem was ,I wasnt handling Resp arrays correctly and the multiple commands were sent at once .

You can now close this

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