Skip to content

Commit

Permalink
Merge #40984
Browse files Browse the repository at this point in the history
40984: workload: revert partition fix for tpcc import r=solongordon a=solongordon

This reverts commit f56a83d. That fix
broke backward compatibility with v2.1, and it is no longer necessary
due to 65c5e37.

Refers #39005

Release note: None

Release justification: Non-production code change

Co-authored-by: Solon Gordon <solon@cockroachlabs.com>
  • Loading branch information
craig[bot] and solongordon committed Sep 23, 2019
2 parents 7f1e8dc + 76a6dda commit b522d0e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/workload/tpcc/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (p *partitioner) randActive(rng *rand.Rand) int {
// default it adds constraints/preferences in terms of racks, but if the zones
// flag is passed into tpcc, it will set the constraints/preferences based on
// the geographic zones provided.
func configureZone(db *gosql.DB, cfg zoneConfig, obj, name, partition string, partIdx int) error {
func configureZone(db *gosql.DB, cfg zoneConfig, table, partition string, partIdx int) error {
var kv string
if len(cfg.zones) > 0 {
kv = fmt.Sprintf("zone=%s", cfg.zones[partIdx])
Expand All @@ -267,8 +267,8 @@ func configureZone(db *gosql.DB, cfg zoneConfig, obj, name, partition string, pa
panic("unexpected")
}

sql := fmt.Sprintf(`ALTER PARTITION %s OF %s %s CONFIGURE ZONE USING %s`,
partition, obj, name, opts)
sql := fmt.Sprintf(`ALTER PARTITION %s OF TABLE %s CONFIGURE ZONE USING %s`,
partition, table, opts)
if _, err := db.Exec(sql); err != nil {
return errors.Wrapf(err, "Couldn't exec %q", sql)
}
Expand Down Expand Up @@ -297,7 +297,7 @@ func partitionObject(
}

for i := 0; i < p.parts; i++ {
if err := configureZone(db, cfg, obj, name, fmt.Sprintf("p%d_%d", idx, i), i); err != nil {
if err := configureZone(db, cfg, table, fmt.Sprintf("p%d_%d", idx, i), i); err != nil {
return err
}
}
Expand Down

0 comments on commit b522d0e

Please sign in to comment.