From 75277348efa0c458a88b1477371ae736261af96e Mon Sep 17 00:00:00 2001 From: Henrik Johansson Date: Thu, 16 May 2019 11:21:51 +0200 Subject: [PATCH] gemini: ensure max pk per bucket in valid range --- CHANGELOG.md | 1 + cmd/gemini/root.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 634c5815..8036dd84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Gemini ensures that primary key buckets do not overflow int32. - Gemini now accepts a list of node host names or IPs for the test and Oracle clusters. - Default maximum primary keys increased to MAX_INT32/concurrency. diff --git a/cmd/gemini/root.go b/cmd/gemini/root.go index 25a1ba5d..a52a267b 100644 --- a/cmd/gemini/root.go +++ b/cmd/gemini/root.go @@ -128,7 +128,7 @@ func readSchema(confFile string) (*gemini.Schema, error) { } func run(cmd *cobra.Command, args []string) { - if pkNumberPerThread == 0 { + if pkNumberPerThread <= 0 || pkNumberPerThread > (math.MaxInt32/concurrency) { pkNumberPerThread = math.MaxInt32 / concurrency } if err := printSetup(); err != nil {