# domain/workflow/action/br - Backup/Restore Actions

**48 Go files** | PITR, snapshot, and lightweight restore operations

## OVERVIEW

Backup and restore workflow actions for TiDB clusters. Includes PITR (Point-in-Time Recovery), snapshot backups, lightweight restores, and BR garbage collection.

## STRUCTURE

```
br/
├── execute_*.go           # Execution actions (backup/restore operations)
├── apply_*.go             # Apply K8s resources (TiBRGC, restore configs)
├── delete_*.go            # Cleanup actions
├── get_*.go               # Information retrieval actions
├── scalemgr*.go           # Scale manager for restore operations
├── mocks/                 # Generated mocks
└── *_test.go              # Tests
```

## WHERE TO LOOK

| Task | File Pattern | Notes |
|------|--------------|-------|
| Add backup action | `execute_*_backup*.go` | Follow existing backup patterns |
| Add restore action | `execute_*_restore*.go` | LW, classic, PITR variants |
| Modify BR GC | `*_tibrgc*.go` | TiBRGC CRD management |
| Scale during restore | `scalemgr*.go` | Component scaling logic |

## KEY CONCEPTS

### Restore Types
- **Classic Restore**: Full cluster restore from snapshot
- **LW (Lightweight) Restore**: Incremental/partial restore
- **PITR Restore**: Point-in-time recovery from logs

### Action Naming
- `execute_kernel_*`: Core BR kernel operations
- `execute_classic_*`: Classic restore flow
- `execute_lw_*`: Lightweight restore flow
- `get_pitr_*`: PITR information retrieval

## CONVENTIONS

- All BR actions interact with `pkg/clustergateway` for BR operations
- Use `tilog` for structured logging with backup/restore IDs
- Test mocks in `mocks/` subdirectory (generated via mockery)
