Things do not always work out. I'm working for a way out.
Published Jul 20, 2024
Some drafts and notes.
mrcoordinator ./pg*txt
then multiple workers
mrworker ././mrapps/app.so
Workflow:
master awake, prepare rpc and splits. workers awake, prepare map/reduce functions and start asking for task.
So I suppose that this is not that hard since it didn’t take much time for me to accomplish the task. To be honest, the reason I’d been stuck for a little while when bash test-mr.sh
is because the path of the file is incorrect (changed it to absolute path later ).
To implement an in-memory server and clients. It’s pretty easy that there’s really no much to talk about.
Techniques Used
2 Things blocked me for a while
A silly mistake - the fact is that Call()
is executed only once, and then there’s a terrible infinite loop
for ok := ck.Call("Server.Put", &args, &reply); !ok
Using Unique Ids to represent values
instead of Reqs - bad things would happen when other clients change the record, hence causing duplicate put/append
The lab is marked Easy, which is true just that I am supposed to finish it in real quick.
I’ve drawn a figure listing out the summary of rules, check out:
Also, some variables and details as:
The rule of log replication can be interpreted as the following graphs:
Demonstrating an unreliable test that I’d debugged for a while and Tips:
In order to back up faster, I also implement the following technique:
By sending XTerm
, XIndex
, and Len
back to the leader, the leader can then quickly decide what nextIndex[target]
should be set and get rid of meaningless retries.
Note: All of the fields in RPC args should be initialized, otherwise the RPC will fail.(on returning(never return))