Skip to content

Commit

Permalink
Ruler: Fix WAL directory in stateless mode (thanos-io#5242)
Browse files Browse the repository at this point in the history
Signed-off-by: Matej Gera <matejgera@gmail.com>
  • Loading branch information
matej-g committed Mar 18, 2022
1 parent 6b80a50 commit 894f013
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/thanos/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,18 @@ func runRule(
return errors.Wrapf(err, "failed to parse remote write config %v", string(rwCfgYAML))
}

walDir := filepath.Join(conf.dataDir, "wal")
// flushDeadline is set to 1m, but it is for metadata watcher only so not used here.
remoteStore := remote.NewStorage(logger, reg, func() (int64, error) {
return 0, nil
}, walDir, 1*time.Minute, nil)
}, conf.dataDir, 1*time.Minute, nil)
if err := remoteStore.ApplyConfig(&config.Config{
GlobalConfig: config.DefaultGlobalConfig,
RemoteWriteConfigs: rwCfg.RemoteWriteConfigs,
}); err != nil {
return errors.Wrap(err, "applying config to remote storage")
}

agentDB, err = agent.Open(logger, reg, remoteStore, walDir, agentOpts)
agentDB, err = agent.Open(logger, reg, remoteStore, conf.dataDir, agentOpts)
if err != nil {
return errors.Wrap(err, "start remote write agent db")
}
Expand Down

0 comments on commit 894f013

Please sign in to comment.