Skip to content

Commit

Permalink
controllers: improve logging message when regions are drained (#20)
Browse files Browse the repository at this point in the history
During recent HBase upgrade we ran into an incident. Folks that had
to respond to the incident were quite confused by the logged message
when regions are being drained from a regionserver about to be
deleted/updated, thinking there was something wrong with how the
operator was draining regions. Improve the logged message to help
reduce confusion.
  • Loading branch information
pidren authored Feb 3, 2022
1 parent c16bd76 commit 08b7a9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/hbase_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (r *HBaseReconciler) moveRegions(ctx context.Context, regions [][]byte, tar
if targets.Len() > 0 {
// get the regionserver with least regions
rc := heap.Pop(&targets).(*rsCount)
r.Log.Info("moving region", "region", string(region),
r.Log.Info("moving regions to regionserver with least regions", "region", string(region),
"target", rc.serverName,
"current_count", rc.regionCount)
mr, err = hrpc.NewMoveRegion(ctx, region, hrpc.WithDestinationRegionServer(rc.serverName))
Expand All @@ -342,8 +342,8 @@ func (r *HBaseReconciler) moveRegions(ctx context.Context, regions [][]byte, tar
rc.regionCount++
heap.Push(&targets, rc)
} else {
// no targets
r.Log.Info("moving region without target", "region", string(region))
// moving regions without a particular target - this is not an error case and guaranteed to hit when draining the first regionserver in the cluster
r.Log.Info("regionservers are balanced and there isn't a regionserver with least regions; moving regions without particular regionserver target", "region", string(region))
mr, err = hrpc.NewMoveRegion(ctx, region)
}
if err != nil {
Expand Down

0 comments on commit 08b7a9d

Please sign in to comment.