From b4ce313de1e21082fcd41d963aa18ccc52d9cc41 Mon Sep 17 00:00:00 2001 From: Maurice van Veen Date: Thu, 26 Sep 2024 15:04:02 +0200 Subject: [PATCH] Warn if using temp storage for JetStream Signed-off-by: Maurice van Veen --- server/jetstream.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/jetstream.go b/server/jetstream.go index a83ded83a3..fea7157506 100644 --- a/server/jetstream.go +++ b/server/jetstream.go @@ -219,6 +219,7 @@ func (s *Server) EnableJetStream(config *JetStreamConfig) error { cfg := *config if cfg.StoreDir == _EMPTY_ { cfg.StoreDir = filepath.Join(os.TempDir(), JetStreamStoreDir) + s.Warnf("Temporary storage directory used, data could be lost on system reboot") } // We will consistently place the 'jetstream' directory under the storedir that was handed to us. Prior to 2.2.3 though @@ -2521,6 +2522,7 @@ func (s *Server) dynJetStreamConfig(storeDir string, maxStore, maxMem int64) *Je } else { // Create one in tmp directory, but make it consistent for restarts. jsc.StoreDir = filepath.Join(os.TempDir(), "nats", JetStreamStoreDir) + s.Warnf("Temporary storage directory used, data could be lost on system reboot") } opts := s.getOpts()