We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func main() { nodes := []string{"shard-1", "shard-2", "shard-3"} config := &xring.Config{ VirtualNodes: len(nodes), LoadFactor: 40, } hashRing := xring.NewRing(nodes, config) keyCount := 100 fmt.Println("with 3 nodes") distribution := simulateKeyDistribution(hashRing, keyCount) printDistribution(distribution) fmt.Println("------------------------------------------------") fmt.Println("with 4 nodes") hashRing.Add("shard-4") distribution = simulateKeyDistribution(hashRing, keyCount) printDistribution(distribution) fmt.Println("------------------------------------------------") fmt.Println("with 5 nodes") hashRing.Add("shard-5") distribution = simulateKeyDistribution(hashRing, keyCount) printDistribution(distribution) fmt.Println("------------------------------------------------") fmt.Println("with 4 nodes") hashRing.Remove("shard-4") distribution = simulateKeyDistribution(hashRing, keyCount) printDistribution(distribution) }
and then I got:
------------------------------------------------ with 4 nodes panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104afbbd8] goroutine 1 [running]: github.com/arriqaaq/rbt.(*Tree).delete(0x140000a13e0?, 0x140000aa4e0?) /Users/akram/go/pkg/mod/github.com/arriqaaq/[email protected]/rbt.go:265 +0x1e8 github.com/arriqaaq/rbt.(*Tree).Delete(0x104afe391?, 0x140000a13e0?) /Users/akram/go/pkg/mod/github.com/arriqaaq/[email protected]/rbt.go:242 +0x2c github.com/argoproj/xring.(*Ring).Remove(0x140000b8000, {0x104afe5d0, 0x7}) /Users/akram/go/src/github.com/arriqaaq/xring/xring.go:144 +0x244 main.main() /Users/akram/go/src/github.com/arriqaaq/xring/examples/relocation.go:82 +0x2a0 exit status 2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
and then I got:
The text was updated successfully, but these errors were encountered: