Merge pull request #1698 from tgruben/backport-1697

backport 1697
This commit is contained in:
Matthew Jaffee 2021-09-15 09:30:23 -05:00 committed by GitHub
commit d7580118ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

8
api.go
View file

@ -2219,9 +2219,9 @@ func mergeIDLists(dst []uint64, src []uint64) []uint64 {
return dst[i] < dst[j]
})
// dedup.
n := 0
n := 1
prev := dst[0]
for i := 0; i < len(dst); i++ {
for i := 1; i < len(dst); i++ {
if dst[i] != prev {
dst[n] = dst[i]
n++
@ -2239,9 +2239,9 @@ func mergeKeyLists(dst []string, src []string) []string {
return dst[i] < dst[j]
})
// dedup.
n := 0
n := 1
prev := dst[0]
for i := 0; i < len(dst); i++ {
for i := 1; i < len(dst); i++ {
if dst[i] != prev {
dst[n] = dst[i]
n++

View file

@ -638,7 +638,13 @@ type mutexCheckField struct {
}
func TestAPI_MutexCheck(t *testing.T) {
c := test.MustRunCluster(t, 3)
c := test.MustNewCluster(t, 3)
for _, c := range c.Nodes {
c.Config.Cluster.ReplicaN = 2
}
if err := c.Start(); err != nil {
t.Fatalf("starting cluster: %v", err)
}
defer c.Close()
m0 := c.GetNode(0)