code: func (db *DB) deleteBlocks(blocks map[ulid.ULID]*Block) error {
  	for ulid, block := range blocks {
  		if block != nil {
  			if err := block.Close(); err != nil {
  				level.Warn(db.logger).Log("msg", "closing block failed", "err", err)
  			}
  		}
  		if err := os.RemoveAll(filepath.Join(db.dir, ulid.String())); err != nil {
  			return errors.Wrapf(err, "delete obsolete block %s", ulid)
  		}
  	}
  	return nil
  }
docs: // deleteBlocks closes and deletes blocks from the disk.
  // When the map contains a non nil block object it means it is loaded in memory
  // so needs to be closed first as it might need to wait for pending readers to complete.