Skip to content

Commit

Permalink
workload: default to fixtures only for pub-facing workloads
Browse files Browse the repository at this point in the history
For internal workloads fixtures won't load because the CRDB cluster
won't know about the workload.

Fixes #81422.
Fixes #81433.
Fixes #81434.
Fixes #81435.

Release note: None
  • Loading branch information
tbg committed May 18, 2022
1 parent 4b65252 commit 682b303
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/workload/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,12 @@ func runInitImpl(
lc := strings.ToLower(*dataLoader)
if lc == "auto" {
lc = "insert"
if workload.SupportsFixtures(gen) {
// Even if it does support fixtures, the CRDB cluster needs to know the
// workload. This can only be expected if the workload is public-facing.
// For example, at the time of writing, neither roachmart and ledger are
// public-facing, but both support fixtures. However, returning true here
// would result in "pq: unknown generator: roachmart" from the cluster.
if workload.SupportsFixtures(gen) && gen.Meta().PublicFacing {
lc = "import"
}
}
Expand Down

0 comments on commit 682b303

Please sign in to comment.