From de0665faf778392824959efb2e85b13a9f54c6c0 Mon Sep 17 00:00:00 2001 From: xhe Date: Mon, 20 Dec 2021 10:25:29 +0800 Subject: [PATCH 1/3] placement: remove isolationlevel Signed-off-by: xhe --- ddl/placement/rule.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ddl/placement/rule.go b/ddl/placement/rule.go index 216714789aec9..88cd5067153f8 100644 --- a/ddl/placement/rule.go +++ b/ddl/placement/rule.go @@ -58,7 +58,6 @@ func NewRule(role PeerRoleType, replicas uint64, cnst Constraints) *Rule { Count: int(replicas), Constraints: cnst, LocationLabels: []string{"region", "zone", "rack", "host"}, - IsolationLevel: "region", } } From 4b47320313c7adc6b707695d17bacfa0d50228f4 Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 21 Dec 2021 13:48:06 +0800 Subject: [PATCH 2/3] placement: fix test Signed-off-by: xhe --- ddl/placement/bundle_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/placement/bundle_test.go b/ddl/placement/bundle_test.go index 225f17f398552..bacd9dc3f873d 100644 --- a/ddl/placement/bundle_test.go +++ b/ddl/placement/bundle_test.go @@ -352,7 +352,7 @@ func (s *testBundleSuite) TestString(c *C) { c.Assert(err, IsNil) bundle.Rules = append(rules1, rules2...) - c.Assert(bundle.String(), Equals, `{"group_id":"TiDB_DDL_1","group_index":0,"group_override":false,"rules":[{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":3,"label_constraints":[{"key":"zone","op":"in","values":["sh"]}],"location_labels":["region","zone","rack","host"],"isolation_level":"region"},{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":4,"label_constraints":[{"key":"zone","op":"notIn","values":["sh"]},{"key":"zone","op":"in","values":["bj"]}],"location_labels":["region","zone","rack","host"],"isolation_level":"region"}]}`) + c.Assert(bundle.String(), Equals, `{"group_id":"TiDB_DDL_1","group_index":0,"group_override":false,"rules":[{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":3,"label_constraints":[{"key":"zone","op":"in","values":["sh"]}],"location_labels":["region","zone","rack","host"]},{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":4,"label_constraints":[{"key":"zone","op":"notIn","values":["sh"]},{"key":"zone","op":"in","values":["bj"]}],"location_labels":["region","zone","rack","host"]}`) c.Assert(failpoint.Enable("github.com/pingcap/tidb/ddl/placement/MockMarshalFailure", `return(true)`), IsNil) defer func() { From cb8865b4bae075cbcedc22e1d4452e9aec864833 Mon Sep 17 00:00:00 2001 From: xhe Date: Tue, 21 Dec 2021 15:19:11 +0800 Subject: [PATCH 3/3] placement: fix tests Signed-off-by: xhe --- ddl/placement/bundle_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/placement/bundle_test.go b/ddl/placement/bundle_test.go index bacd9dc3f873d..3c11559f06304 100644 --- a/ddl/placement/bundle_test.go +++ b/ddl/placement/bundle_test.go @@ -352,7 +352,7 @@ func (s *testBundleSuite) TestString(c *C) { c.Assert(err, IsNil) bundle.Rules = append(rules1, rules2...) - c.Assert(bundle.String(), Equals, `{"group_id":"TiDB_DDL_1","group_index":0,"group_override":false,"rules":[{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":3,"label_constraints":[{"key":"zone","op":"in","values":["sh"]}],"location_labels":["region","zone","rack","host"]},{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":4,"label_constraints":[{"key":"zone","op":"notIn","values":["sh"]},{"key":"zone","op":"in","values":["bj"]}],"location_labels":["region","zone","rack","host"]}`) + c.Assert(bundle.String(), Equals, `{"group_id":"TiDB_DDL_1","group_index":0,"group_override":false,"rules":[{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":3,"label_constraints":[{"key":"zone","op":"in","values":["sh"]}],"location_labels":["region","zone","rack","host"]},{"group_id":"","id":"","start_key":"","end_key":"","role":"voter","count":4,"label_constraints":[{"key":"zone","op":"notIn","values":["sh"]},{"key":"zone","op":"in","values":["bj"]}],"location_labels":["region","zone","rack","host"]}]}`) c.Assert(failpoint.Enable("github.com/pingcap/tidb/ddl/placement/MockMarshalFailure", `return(true)`), IsNil) defer func() {