Skip to content

Commit c739352

Browse files
Improved warning for Observer mode (#7433)
This is purely a documentation/info update, which catches a situation where a correctly configured leaf cluster would fail to elect a meta leader, but the user would be left completely clueless as to why. When a cluster is started the first time(!) it will check if leaf nodes connections to SYS are configured. If this is the case the leaf cluster MAY be an extension of a hub cluster. It cannot verify this until the connection is actually made and it can compare jetstream domains (its an extension only if the domains are the same) As a result the cluster goes into "Observer mode" in which meta leader election is deferred till the hub is connection via a SYS leaf node connection. BUT, not hint is printed on the FIRST start- only on the SECOND start of the cluster a hint was printed. The /healthz probe fails with a 503 and no further details beyond `"JetStream has not established contact with a meta leader"` This leaves the user completely clueless as to why the meta leader was not elected. `nats server report jetstream` also gives no hint as to the reason. This change prints the extension_hint warning on first start and extends the explanation. [skip ci] Signed-off-by: Michael Röschter <michael@roeschter.de>
2 parents 8469612 + a16c578 commit c739352

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/jetstream_cluster.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,9 @@ func (js *jetStream) setupMetaGroup() error {
896896
}
897897
if cfg.Observer {
898898
s.Noticef("Turning JetStream metadata controller Observer Mode on")
899+
s.Noticef("In cases where the JetStream domain is not intended to be extended through a SYS account leaf node connection")
900+
s.Noticef("and waiting for leader election until first contact is not acceptable,")
901+
s.Noticef(`manually disable Observer Mode by setting the JetStream Option "extension_hint: %s"`, jsNoExtend)
899902
}
900903
} else {
901904
s.Noticef("JetStream cluster recovering state")
@@ -909,7 +912,7 @@ func (js *jetStream) setupMetaGroup() error {
909912
cfg.Observer = false
910913
case extUndetermined:
911914
s.Noticef("Turning JetStream metadata controller Observer Mode on - no previous contact")
912-
s.Noticef("In cases where JetStream will not be extended")
915+
s.Noticef("In cases where the JetStream domain is not intended to be extended through a SYS account leaf node connection")
913916
s.Noticef("and waiting for leader election until first contact is not acceptable,")
914917
s.Noticef(`manually disable Observer Mode by setting the JetStream Option "extension_hint: %s"`, jsNoExtend)
915918
}

0 commit comments

Comments
 (0)