Skip to content

Commit

Permalink
Merge #113501
Browse files Browse the repository at this point in the history
113501: roachtest: bump GC TTL on source and dest tenant ranges for weekly roachtest r=msbutler a=adityamaru

Previously, the kv50 weekly roachtest would take >4 hours, the default GC TTL, to complete replication and cutover. Thus, by the time fingerprinting would run some of the keys would already be under the GCThreshold before the FP machinery got a chance to write a PTS. To work around this we bump the GC TTL on the source and dest tenant ranges to 12 hours, the timeout of the roachtest.

Fixes: #112823
Release note: None

Co-authored-by: adityamaru <[email protected]>
  • Loading branch information
craig[bot] and adityamaru committed Nov 1, 2023
2 parents 150623d + f1937ec commit b22b3f1
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pkg/cmd/roachtest/tests/cluster_to_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ type replicationSpec struct {
// multiregion specifies multiregion cluster specs
multiregion multiRegionSpecs

// overrideTenantTTL specifies the TTL that will be applied by the system tenant on
// both the source and destination tenant range.
overrideTenantTTL time.Duration

// additionalDuration specifies how long the workload will run after the initial scan
//completes. If the time out is set to 0, it will run until completion.
additionalDuration time.Duration
Expand Down Expand Up @@ -524,6 +528,8 @@ func (rd *replicationDriver) setupC2C(
srcClusterSettings(t, srcSQL)
destClusterSettings(t, destSQL, rd.rs.additionalDuration)

overrideSrcAndDestTenantTTL(t, srcSQL, destSQL, rd.rs.overrideTenantTTL)

createTenantAdminRole(t, "src-system", srcSQL)
createTenantAdminRole(t, "dst-system", destSQL)

Expand Down Expand Up @@ -1148,7 +1154,11 @@ func registerClusterToCluster(r registry.Registry) {
maxBlockBytes: 4096,
maxQPS: 2000,
},
timeout: 12 * time.Hour,
timeout: 12 * time.Hour,
// We bump the TTL on the source and destination tenants to 12h to give
// the fingerprinting post cutover adequate time to complete before GC
// kicks in.
overrideTenantTTL: 12 * time.Hour,
additionalDuration: 2 * time.Hour,
cutover: 0,
clouds: registry.AllClouds,
Expand Down Expand Up @@ -1744,6 +1754,17 @@ func destClusterSettings(t test.Test, db *sqlutils.SQLRunner, additionalDuration
}
}

func overrideSrcAndDestTenantTTL(
t test.Test, srcSQL *sqlutils.SQLRunner, destSQL *sqlutils.SQLRunner, overrideTTL time.Duration,
) {
if overrideTTL == 0 {
return
}
t.L().Printf("overriding dest and src tenant TTL to %s", overrideTTL)
srcSQL.Exec(t, `ALTER RANGE tenants CONFIGURE ZONE USING gc.ttlseconds = $1`, overrideTTL.Seconds())
destSQL.Exec(t, `ALTER RANGE tenants CONFIGURE ZONE USING gc.ttlseconds = $1`, overrideTTL.Seconds())
}

func copyPGCertsAndMakeURL(
ctx context.Context,
t test.Test,
Expand Down

0 comments on commit b22b3f1

Please sign in to comment.