Skip to content

Commit

Permalink
Merge pull request #17856 from serathius/robustness-datadir-lazyfs
Browse files Browse the repository at this point in the history
Persist member data with lazyfs enabled
  • Loading branch information
serathius committed Apr 23, 2024
2 parents 94b155a + 9fcde37 commit c2a3ca6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/robustness/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func testRobustness(ctx context.Context, t *testing.T, lg *zap.Logger, s testSce
if err != nil {
t.Fatal(err)
}
defer r.Cluster.Close()
defer forcestopCluster(r.Cluster)

if s.failpoint == nil {
s.failpoint, err = failpoint.PickRandom(r.Cluster)
Expand All @@ -95,7 +95,6 @@ func testRobustness(ctx context.Context, t *testing.T, lg *zap.Logger, s testSce
if err != nil {
t.Fatal(err)
}
forcestopCluster(r.Cluster)

watchProgressNotifyEnabled := r.Cluster.Cfg.ServerConfig.ExperimentalWatchProgressNotifyInterval != 0
validateGotAtLeastOneProgressNotify(t, r.Client, s.watch.requestProgress || watchProgressNotifyEnabled)
Expand Down
10 changes: 9 additions & 1 deletion tests/robustness/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@ func (r *TestReport) Report(t *testing.T, force bool) {

func persistMemberDataDir(t *testing.T, lg *zap.Logger, member e2e.EtcdProcess, path string) {
lg.Info("Saving member data dir", zap.String("member", member.Config().Name), zap.String("path", path))
err := os.Rename(member.Config().DataDirPath, path)
err := os.Rename(memberDataDir(member), path)
if err != nil {
t.Fatal(err)
}
}

func memberDataDir(member e2e.EtcdProcess) string {
lazyFS := member.LazyFS()
if lazyFS != nil {
return filepath.Join(lazyFS.LazyFSDir, "data")
}
return member.Config().DataDirPath
}
2 changes: 1 addition & 1 deletion tests/robustness/report/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func LoadClusterPersistedRequests(lg *zap.Logger, path string) ([]model.EtcdRequ
func PersistedRequestsCluster(lg *zap.Logger, cluster *e2e.EtcdProcessCluster) ([]model.EtcdRequest, error) {
dataDirs := []string{}
for _, proc := range cluster.Procs {
dataDirs = append(dataDirs, proc.Config().DataDirPath)
dataDirs = append(dataDirs, memberDataDir(proc))
}
return PersistedRequestsDirs(lg, dataDirs)
}
Expand Down

0 comments on commit c2a3ca6

Please sign in to comment.