Skip to content

Commit 847722e

Browse files
committed
server: minor cleanup of logging around draining
This commit moves the "drain succeeded" logging message to be at the very end of the drain process. Also, it removes now stale comment. Release note: None
1 parent 990dfdc commit 847722e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/server/drain.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,6 @@ func (s *drainServer) drainClients(
447447
// tasks that may issue SQL statements have shut down.
448448
s.sqlServer.leaseMgr.SetDraining(ctx, true /* drain */, reporter)
449449

450-
// Mark this phase in the logs to clarify the context of any subsequent
451-
// errors/warnings, if any.
452-
log.Infof(ctx, "SQL server drained successfully; SQL queries cannot execute any more")
453-
454450
session, err := s.sqlServer.sqlLivenessProvider.Release(ctx)
455451
if err != nil {
456452
return err
@@ -464,8 +460,9 @@ func (s *drainServer) drainClients(
464460

465461
// Mark the node as fully drained.
466462
s.sqlServer.gracefulDrainComplete.Set(true)
467-
468-
// Done. This executes the defers set above to drain SQL leases.
463+
// Mark this phase in the logs to clarify the context of any subsequent
464+
// errors/warnings, if any.
465+
log.Infof(ctx, "SQL server drained successfully; SQL queries cannot execute any more")
469466
return nil
470467
}
471468

0 commit comments

Comments
 (0)