Tombstone renames the block's meta.json to meta.deleted.json. Idempotent for already-tombstoned blocks (returns nil if meta.json is missing). See common.WALBlock.Tombstone for semantics.
()
| 545 | // for already-tombstoned blocks (returns nil if meta.json is missing). |
| 546 | // See common.WALBlock.Tombstone for semantics. |
| 547 | func (b *walBlock) Tombstone() error { |
| 548 | from := filepath.Join(b.walPath(), backend.MetaName) |
| 549 | to := filepath.Join(b.walPath(), backend.DeletedMetaName) |
| 550 | if err := os.Rename(from, to); err != nil { |
| 551 | if os.IsNotExist(err) { |
| 552 | return nil |
| 553 | } |
| 554 | return fmt.Errorf("failed to tombstone wal block %s: %w", b.meta.BlockID, err) |
| 555 | } |
| 556 | return nil |
| 557 | } |
| 558 | |
| 559 | func (b *walBlock) FindTraceByID(ctx context.Context, id common.ID, opts common.SearchOptions) (*tempopb.TraceByIDResponse, error) { |
| 560 | ctx, span := tracer.Start(ctx, "walBlock.FindTraceByID") |