Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachtest: apply faster schema change cluster settings #75989

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 22 additions & 76 deletions pkg/cmd/roachtest/tests/orm_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,84 +34,30 @@ func alterZoneConfigAndClusterSettings(
}
defer db.Close()

if _, err := db.ExecContext(
ctx, `ALTER RANGE default CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `ALTER DATABASE system CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `ALTER TABLE system.public.jobs CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `ALTER RANGE meta CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `ALTER RANGE system CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `ALTER RANGE liveness CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 60;`,
); err != nil {
return err
}

if _, err := db.ExecContext(
ctx, `SET CLUSTER SETTING jobs.retention_time = '180s';`,
); err != nil {
return err
}

// Shorten the merge queue interval to clean up ranges due to dropped tables.
if _, err := db.ExecContext(
ctx, `SET CLUSTER SETTING kv.range_merge.queue_interval = '200ms'`,
); err != nil {
return err
}

// Disable syncs associated with the Raft log which are the primary causes of
// fsyncs.
if _, err := db.ExecContext(
ctx, `SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = 'true'`,
); err != nil {
return err
}

// Enable temp tables
if _, err := db.ExecContext(
ctx, `SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true';`,
); err != nil {
return err
}

// Enable datestyle.
if _, err := db.ExecContext(
ctx,
for _, cmd := range []string{
`ALTER RANGE default CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 5;`,
`ALTER TABLE system.public.jobs CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 5;`,
`ALTER RANGE meta CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 5;`,
`ALTER RANGE system CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 5;`,
`ALTER RANGE liveness CONFIGURE ZONE USING num_replicas = 1, gc.ttlseconds = 5;`,

`SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms'`,
`SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = 'true'`,
`SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';`,
`SET CLUSTER SETTING jobs.registry.interval.gc = '30s';`,
`SET CLUSTER SETTING jobs.retention_time = '15s';`,
`SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;`,
`SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';`,
`SET CLUSTER SETTING sql.catalog.unsafe_skip_system_config_trigger.enabled = true;`,

// Enable experimental features.
`SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true';`,
`SET CLUSTER SETTING sql.defaults.datestyle.enabled = true`,
); err != nil {
return err
}

// Enable intervalstyle.
if _, err := db.ExecContext(
ctx,
`SET CLUSTER SETTING sql.defaults.intervalstyle.enabled = true;`,
); err != nil {
return err
} {
if _, err := db.ExecContext(ctx, cmd); err != nil {
return err
}
}

return nil
Expand Down