Skip to content

Commit

Permalink
chore(v2): add some more safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kolesnikovae committed Jan 21, 2025
1 parent b14df27 commit 4c8cff6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/experiment/metastore/compaction_raft_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ func (h *CompactionCommandHandler) UpdateCompactionPlan(

for _, job := range req.PlanUpdate.CompletedJobs {
compacted := job.GetCompactedBlocks()
if compacted == nil {
level.Error(h.logger).Log("msg", "compacted blocks are missing", "job", job.State.Name)
if compacted == nil || compacted.SourceBlocks == nil || len(compacted.NewBlocks) == 0 {
level.Warn(h.logger).Log("msg", "compacted blocks are missing; skipping", "job", job.State.Name)
continue
}
if err := h.tombstones.AddTombstones(tx, cmd, blockTombstonesForCompletedJob(job)); err != nil {
Expand Down

0 comments on commit 4c8cff6

Please sign in to comment.