Skip to content

Commit

Permalink
[yt/admin/cms] Allow banning offline nodes with maintenance far ahead.
Browse files Browse the repository at this point in the history
commit_hash:8aa655f765497065441d60a130a1869fa585b0e9
  • Loading branch information
verytable committed Nov 6, 2024
1 parent 2bd95ca commit 62ecea6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/cms/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func (p *TaskProcessor) decommissionNode(ctx context.Context, r *models.Node) {

storedChunkCount := node.Statistics.TotalStoredChunkCount
nodeWithoutChunks := storedChunkCount == 0 && node.State == ytsys.NodeStateOnline
nodeOffline := p.checkNodeOffline(node)

if !task.IsGroupTask && !nodeWithoutChunks && time.Since(p.lastNodeBanTime) < p.conf.BannedNodeHoldOffPeriod {
p.l.Info("can not ban node as another one was banned recently", p.nodeLogFields(task, r)...)
Expand All @@ -322,7 +323,7 @@ func (p *TaskProcessor) decommissionNode(ctx context.Context, r *models.Node) {
unrecoverableDataSafe := p.chunkIntegrity.CheckUnrecoverable() &&
(chunkIntegrityIntact || !chunkIntegrityIntact && storedChunkCount <= p.conf.IgnorePMCThreshold)

if task.IsGroupTask && !task.IsUrgent() && !nodeWithoutChunks {
if task.IsGroupTask && !task.IsUrgent() && !nodeOffline && !nodeWithoutChunks {
p.l.Info("will not ban node as maintenance is far ahead",
p.nodeLogFields(task, r, log.String("indicators", p.chunkIntegrity.String()),
log.Int64("total_stored_chunks", storedChunkCount),
Expand Down

0 comments on commit 62ecea6

Please sign in to comment.