Closed JKOK005 closed 4 years ago
Also note an additional bug. Hash group number is wrongly set. The number should be 1 but it is declared as 0
Resolving the issue with basehashgroup =0
Suspect that it is due to the following lines:
func (f *FingerTable) findSuccessor(baseHashGroupsInt []uint32, value uint32, successors *[]util.NodeInfo) bool { /* Iterate through list of baseHashGroups Check if the correct hash is found and add to the successors */ for _, eInt := range baseHashGroupsInt { if eInt == value { nodePath, _ := zkCli.GetNodePaths(zkCli. PrependNodePath(fmt.Sprintf("%d", eInt))) nodeData, _ := zkCli.GetNodeValue(zkCli.PrependNodePath(fmt. Sprintf("%d/%s", eInt, nodePath[0]))) nodeInfo := new(util.NodeInfo) json.Unmarshal(nodeData, nodeInfo) nodeInfo.IsLocal = false *successors = append(*successors, *nodeInfo) return true } } return false }
Line 52 in Fingertable.go
When you create a new nodeinfo, you only unmarshall the information registered in ZooKeeper. The information registered are only the node's address and port.
As such, the basehashgroup value gets initialised with a 0 value by default in the call to nodeInfo := new(util.NodeInfo)
Fixed with branch, has been merged.
is_local flag is set to false for the node itself. This messes up finger table routing.
From screen shot, we note that the node is constantly requesting the data to be routed to itself since is_local flag is set to false. This triggers an infinite recursion loop which causes the program to crash eventually