tools/benchmark: exit when txn-ops is larger than key-space-size to avoid key duplicated error. (#11499)

release-3.5
Yuchen Zhou 2020-01-06 16:36:51 -08:00 committed by Xiang Li
parent e6980b1f9f
commit 6ffd9f659e
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ func txnPutFunc(cmd *cobra.Command, args []string) {
os.Exit(1)
}
if txnPutOpsPerTxn > keySpaceSize {
fmt.Fprintf(os.Stderr, "expected --txn-ops no larger than --key-space-size, "+
"got txn-ops(%v) key-space-size(%v)\n", txnPutOpsPerTxn, keySpaceSize)
os.Exit(1)
}
requests := make(chan []v3.Op, totalClients)
if txnPutRate == 0 {
txnPutRate = math.MaxInt32