I am trying to use a remote procedure which will set a reply in a struct, with a boolean status and a string as next input. In the procedure, I am setting the boolean status as true and putting a value into input. But in the client, it gets a false status and empty string. In Procedure:
func(c *Coordinator)MapJob(req mr.MapRequest, reply *mr.MapResponse) error {
//logic to set up response...
reply = &mr.MapResponse{
Status: newStatus,
Input: newIn,
}
fmt.Printf("[REPLY] %+v\n", reply)
return nil
}
prints [REPLY] &{Status:true Input:1.txt}
while in client:
err := client.Call("Coordinator.MapJob", req, &reply)
fmt.Printf("reply from procedure %+v\n", reply)
prints:reply from procedure {Status:false Input:}
What am I missing here? I have put the whole code in https://github.com/Brotchu/ProjectMR The procedure is defined in coordinator, and client in worker. It may be too much to paste it all in here.