targetMapVersionMismatch updates map version of a few targets, kill the primary proxy wait for the new leader to come online
(getNum func(int) int, t *testing.T, proxyURL string)
| 622 | // targetMapVersionMismatch updates map version of a few targets, kill the primary proxy |
| 623 | // wait for the new leader to come online |
| 624 | func targetMapVersionMismatch(getNum func(int) int, t *testing.T, proxyURL string) { |
| 625 | smap := tutils.GetClusterMap(t, proxyURL) |
| 626 | tlog.Logf("targets: %d, proxies: %d\n", smap.CountActiveTargets(), smap.CountActiveProxies()) |
| 627 | |
| 628 | smap.Version++ |
| 629 | jsonMap, err := jsoniter.Marshal(smap) |
| 630 | tassert.CheckFatal(t, err) |
| 631 | |
| 632 | n := getNum(smap.CountActiveTargets() + smap.CountActiveProxies() - 1) |
| 633 | for _, v := range smap.Tmap { |
| 634 | if n == 0 { |
| 635 | break |
| 636 | } |
| 637 | baseParams := tutils.BaseAPIParams(v.URL(cmn.NetPublic)) |
| 638 | baseParams.Method = http.MethodPut |
| 639 | reqParams := &api.ReqParams{ |
| 640 | BaseParams: baseParams, |
| 641 | Path: apc.URLPathDae.Join(apc.SyncSmap), |
| 642 | Body: jsonMap, |
| 643 | Header: http.Header{cos.HdrContentType: []string{cos.ContentJSON}}, |
| 644 | } |
| 645 | err = reqParams.DoHTTPRequest() |
| 646 | tassert.CheckFatal(t, err) |
| 647 | n-- |
| 648 | } |
| 649 | killRestorePrimary(t, proxyURL, false, nil) |
| 650 | } |
| 651 | |
| 652 | // concurrentPutGetDel does put/get/del sequence against all proxies concurrently |
| 653 | func concurrentPutGetDel(t *testing.T) { |
no test coverage detected