-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8817 from BramGruneir/8473
server: enable test cluster to take different store configurations
- Loading branch information
Showing
11 changed files
with
84 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
// | ||
// Author: Bram Gruneir ([email protected]) | ||
|
||
package server | ||
package base | ||
|
||
import ( | ||
"bytes" | ||
|
@@ -26,15 +26,18 @@ import ( | |
|
||
"github.com/dustin/go-humanize" | ||
|
||
"github.com/cockroachdb/cockroach/config" | ||
"github.com/cockroachdb/cockroach/roachpb" | ||
"github.com/cockroachdb/cockroach/util/humanizeutil" | ||
) | ||
|
||
// This file implements method receivers for members of server.Context struct | ||
// -- 'Stores' and 'JoinList', which satisfies pflag's value interface | ||
|
||
var minimumStoreSize = 10 * config.DefaultZoneConfig().RangeMaxBytes | ||
// MinimumStoreSize is the smallest size in bytes that a store can have. This | ||
// number is based on config's defaultZoneConfig's RangeMaxBytes, which is | ||
// extremely stable. To avoid adding the dependency on config here, it is just | ||
// hard coded to 640MiB. | ||
const MinimumStoreSize = 10 * 64 << 20 | ||
|
||
// StoreSpec contains the details that can be specified in the cli pertaining | ||
// to the --store flag. | ||
|
@@ -166,9 +169,9 @@ func newStoreSpec(value string) (StoreSpec, error) { | |
if err != nil { | ||
return StoreSpec{}, fmt.Errorf("could not parse store size (%s) %s", value, err) | ||
} | ||
if ss.SizeInBytes < minimumStoreSize { | ||
if ss.SizeInBytes < MinimumStoreSize { | ||
return StoreSpec{}, fmt.Errorf("store size (%s) must be larger than %s", value, | ||
humanizeutil.IBytes(minimumStoreSize)) | ||
humanizeutil.IBytes(MinimumStoreSize)) | ||
} | ||
} | ||
case "attrs": | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
// | ||
// Author: Bram Gruneir ([email protected]) | ||
|
||
package server | ||
package base | ||
|
||
import ( | ||
"fmt" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters