Prevent configuring first_seq on mirrors

Signed-off-by: Neil Twigg <neil@nats.io>
This commit is contained in:
Neil Twigg
2023-07-28 17:08:11 +01:00
parent b22cdf18fe
commit 3c3ad47dd1
3 changed files with 27 additions and 0 deletions

View File

@@ -1159,6 +1159,9 @@ func (s *Server) checkStreamCfg(config *StreamConfig, acc *Account) (StreamConfi
// Do some pre-checking for mirror config to avoid cycles in clustered mode.
if cfg.Mirror != nil {
if cfg.FirstSeq > 0 {
return StreamConfig{}, NewJSMirrorWithFirstSeqError()
}
if len(cfg.Subjects) > 0 {
return StreamConfig{}, NewJSMirrorWithSubjectsError()