mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Fix raft log debug reloading
Signed-off-by: Waldemar Quevedo <wally@nats.io>
This commit is contained in:
@@ -563,11 +563,10 @@ func (s *Server) lookupRaftNode(group string) RaftNode {
|
||||
return n
|
||||
}
|
||||
|
||||
func (s *Server) reloadDebugRaftNodes() {
|
||||
func (s *Server) reloadDebugRaftNodes(debug bool) {
|
||||
if s == nil {
|
||||
return
|
||||
}
|
||||
debug := atomic.LoadInt32(&s.logging.debug) > 0
|
||||
s.rnMu.RLock()
|
||||
for _, ni := range s.raftNodes {
|
||||
n := ni.(*raft)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2022 The NATS Authors
|
||||
// Copyright 2017-2023 The NATS Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
@@ -148,7 +148,7 @@ type debugOption struct {
|
||||
// However we will kick the raft nodes if they exist to reload.
|
||||
func (d *debugOption) Apply(server *Server) {
|
||||
server.Noticef("Reloaded: debug = %v", d.newValue)
|
||||
server.reloadDebugRaftNodes()
|
||||
server.reloadDebugRaftNodes(d.newValue)
|
||||
}
|
||||
|
||||
// logtimeOption implements the option interface for the `logtime` setting.
|
||||
|
||||
Reference in New Issue
Block a user