Master func (m *) runNewReduceWorker (WorkerID int, ReduceID int) {
M.r educeTaskQueue [ReduceID] Init ()
M.m utexForWorkerIDtoReduceID. The Lock ()
M. orkerIDtoReduceID [WorkerID]=ReduceID//1
The Print (" [runNewReduceWorker] m. orkerIDtoReduceID [WorkerID] reduce id ", m. orkerIDtoReduceID [WorkerID], "the worker", WorkerID)
M.m utexForWorkerIDtoReduceID. Unlock ()
M. est_ClearReduceWorker (WorkerID, 1)
}
Master func (m *) Test_ClearReduceWorker (workerID int, invalidPara int) {
ClearReduceID:=1
M.m utexForWorkerIDtoReduceID. The Lock ()
ClearReduceID=m. orkerIDtoReduceID [WorkerID]
M.m utexForWorkerIDtoReduceID. Unlock ()
InvalidPara=2
The Print (" [Test_ClearReduceWorker] reduce id: "ClearReduceID," the worker ", workerID)
}
2020/12/30 10:17:10 [runNewReduceWorker] m. orkerIDtoReduceID [WorkerID] reduce id 77 worker10
2020/12/30 10:17:10 [Test_ClearReduceWorker] reduce id: 0 worker 10
In Test_ClearReduceWorker invoked, reduce id becomes 0 (not found), what is this?