diff --git a/components/bench/ycsb.go b/components/bench/ycsb.go index 62292f3ace..2db1e11e5c 100644 --- a/components/bench/ycsb.go +++ b/components/bench/ycsb.go @@ -139,11 +139,11 @@ func registerYcsb(root *cobra.Command) { cmd.PersistentFlags().Uint32Var(&config.ConnCount, "conncount", 128, "Connection Count") cmd.PersistentFlags().BoolVar(&config.ReadAllFields, "readallfields", true, "Whether Read All Fields") - cmd.PersistentFlags().Float32Var(&config.ReadProportion, "readproportion", 0, "What proportion of operations are reads") - cmd.PersistentFlags().Float32Var(&config.UpdateProportion, "updateproportion", 0, "What proportion of operations are updates") - cmd.PersistentFlags().Float32Var(&config.ScanProportion, "scanproportion", 0, "What proportion of operations are scans") - cmd.PersistentFlags().Float32Var(&config.InsertProportion, "insertproportion", 0, "What proportion of operations are inserts") - cmd.PersistentFlags().Float32Var(&config.ReadModifyWriteProportion, "readmodifywriteproportion", 0, "What proportion of operations are read-modify-write") + cmd.PersistentFlags().Float32Var(&config.ReadProportion, "readproportion", 0.95, "What proportion of operations are reads, default 0.95") + cmd.PersistentFlags().Float32Var(&config.UpdateProportion, "updateproportion", 0.05, "What proportion of operations are updates, default 0.05") + cmd.PersistentFlags().Float32Var(&config.ScanProportion, "scanproportion", 0, "What proportion of operations are scans, default 0") + cmd.PersistentFlags().Float32Var(&config.InsertProportion, "insertproportion", 0, "What proportion of operations are inserts, default 0") + cmd.PersistentFlags().Float32Var(&config.ReadModifyWriteProportion, "readmodifywriteproportion", 0, "What proportion of operations are read-modify-write, default 0") cmd.PersistentFlags().StringVar(&config.RequestDistribution, "requestdistribution", "uniform", "The distribution of requests across the keyspace, [zipfian, uniform, latest]") diff --git a/pkg/cluster/spec/validate.go b/pkg/cluster/spec/validate.go index 4c289d4674..32d4058ac3 100644 --- a/pkg/cluster/spec/validate.go +++ b/pkg/cluster/spec/validate.go @@ -624,6 +624,9 @@ func (s *Specification) portConflictsDetect() error { "WebPort", "TCPPort", "HTTPPort", + "FlashServicePort", + "FlashProxyPort", + "FlashProxyStatusPort", "ClusterPort", "NgPort", } diff --git a/pkg/cluster/spec/validate_test.go b/pkg/cluster/spec/validate_test.go index cc6b4db841..0355510467 100644 --- a/pkg/cluster/spec/validate_test.go +++ b/pkg/cluster/spec/validate_test.go @@ -129,6 +129,58 @@ tikv_servers: c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tidb_servers:172.16.5.138.port' and 'tikv_servers:172.16.5.138.status_port'") + topo = Specification{} + err = yaml.Unmarshal([]byte(` +global: + user: "test1" + ssh_port: 220 + deploy_dir: "test-deploy" + data_dir: "test-data" +tiflash_servers: + - host: 172.16.5.138 + tcp_port: 111 + http_port: 222 + flash_service_port: 1234 + flash_proxy_port: 444 + flash_proxy_status_port: 555 + metrics_port: 666 + - host: 172.16.5.138 + tcp_port: 1111 + http_port: 1222 + flash_service_port: 1333 + flash_proxy_port: 1444 + flash_proxy_status_port: 1234 + metrics_port: 1666 +`), &topo) + c.Assert(err, NotNil) + c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tiflash_servers:172.16.5.138.flash_service_port' and 'tiflash_servers:172.16.5.138.flash_proxy_status_port'") + + topo = Specification{} + err = yaml.Unmarshal([]byte(` +global: + user: "test1" + ssh_port: 220 + deploy_dir: "test-deploy" + data_dir: "test-data" +tiflash_servers: + - host: 172.16.5.138 + tcp_port: 111 + http_port: 222 + flash_service_port: 333 + flash_proxy_port: 1234 + flash_proxy_status_port: 555 + metrics_port: 666 + - host: 172.16.5.138 + tcp_port: 1111 + http_port: 1222 + flash_service_port: 1333 + flash_proxy_port: 1234 + flash_proxy_status_port: 1555 + metrics_port: 1666 +`), &topo) + c.Assert(err, NotNil) + c.Assert(err.Error(), Equals, "port conflict for '1234' between 'tiflash_servers:172.16.5.138.flash_proxy_port' and 'tiflash_servers:172.16.5.138.flash_proxy_port'") + topo = Specification{} // tispark_masters has "omitempty" in its tag value err = yaml.Unmarshal([]byte(`