Skip to content

Commit edb208b

Browse files
committed
metamorphic: use store-relative paths
1 parent 2612620 commit edb208b

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

metamorphic/meta.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -540,19 +540,13 @@ func RunOnce(t TestingT, runDir string, seed uint64, historyPath string, rOpts .
540540
testOpts.Opts.WALFailover = nil
541541
} else {
542542
testOpts.Opts.WALFailover.Secondary.FS = opts.FS
543-
testOpts.Opts.WALFailover.Secondary.Dirname = opts.FS.PathJoin(
544-
runDir, testOpts.Opts.WALFailover.Secondary.Dirname)
545543
}
546544
}
547545

548-
if opts.WALDir != "" {
549-
if runOpts.numInstances > 1 {
550-
// TODO(bilal): Allow opts to diverge on a per-instance basis, and use
551-
// that to set unique WAL dirs for all instances in multi-instance mode.
552-
opts.WALDir = ""
553-
} else {
554-
opts.WALDir = opts.FS.PathJoin(runDir, opts.WALDir)
555-
}
546+
if runOpts.numInstances > 1 {
547+
// TODO(bilal): Allow opts to diverge on a per-instance basis, and use
548+
// that to set unique WAL dirs for all instances in multi-instance mode.
549+
opts.WALDir = ""
556550
}
557551

558552
historyFile, err := os.Create(historyPath)

metamorphic/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ func standardOptions(kf KeyFormat) []*TestOptions {
558558
`,
559559
10: `
560560
[Options]
561-
wal_dir=data/wal
561+
wal_dir={store_path}/wal
562562
`,
563563
11: `
564564
[Level "0"]
@@ -738,7 +738,7 @@ func RandomOptions(
738738
opts.MemTableSize = 2 << (10 + uint(rng.IntN(16))) // 2KB - 256MB
739739
opts.MemTableStopWritesThreshold = 2 + rng.IntN(5) // 2 - 5
740740
if rng.IntN(2) == 0 {
741-
opts.WALDir = "data/wal"
741+
opts.WALDir = pebble.MakeStoreRelativePath(opts.FS, "wal")
742742
}
743743

744744
// Half the time enable WAL failover.
@@ -761,7 +761,7 @@ func RandomOptions(
761761
// must not exceed 119x the probe interval.
762762
healthyInterval := scaleDuration(probeInterval, 1.0, 119.0)
763763
opts.WALFailover = &pebble.WALFailoverOptions{
764-
Secondary: wal.Dir{FS: vfs.Default, Dirname: "data/wal_secondary"},
764+
Secondary: wal.Dir{FS: vfs.Default, Dirname: pebble.MakeStoreRelativePath(vfs.Default, "wal_secondary")},
765765
FailoverOptions: wal.FailoverOptions{
766766
PrimaryDirProbeInterval: probeInterval,
767767
HealthyProbeLatencyThreshold: healthyThreshold,

0 commit comments

Comments
 (0)