Skip to content

Commit

Permalink
server: minor cleanup of logging around draining
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yuzefovich committed Aug 10, 2023
1 parent 990dfdc commit 847722e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/server/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ func (s *drainServer) drainClients(
// tasks that may issue SQL statements have shut down.
s.sqlServer.leaseMgr.SetDraining(ctx, true /* drain */, reporter)

// Mark this phase in the logs to clarify the context of any subsequent
// errors/warnings, if any.
log.Infof(ctx, "SQL server drained successfully; SQL queries cannot execute any more")

session, err := s.sqlServer.sqlLivenessProvider.Release(ctx)
if err != nil {
return err
Expand All @@ -464,8 +460,9 @@ func (s *drainServer) drainClients(

// Mark the node as fully drained.
s.sqlServer.gracefulDrainComplete.Set(true)

// Done. This executes the defers set above to drain SQL leases.
// Mark this phase in the logs to clarify the context of any subsequent
// errors/warnings, if any.
log.Infof(ctx, "SQL server drained successfully; SQL queries cannot execute any more")
return nil
}

Expand Down

0 comments on commit 847722e

Please sign in to comment.