miroir/crates
jedarden 55d44f715d feat(ttl): implement actual TTL sweep logic with NodeClient integration
Implemented the core TTL sweep functionality that was previously stubbed:
- Added NodeClient and topology to TtlManager for executing deletes
- Implemented run_sweep() that iterates through owned shards and issues
  delete_by_filter requests with proper origin tagging (ORIGIN_TTL_EXPIRE)
- Added metrics callbacks for tracking expired documents and sweep duration
- Updated TtlManager constructor to match TtlWorker expectations
- Added Clone implementation for TtlManager

The sweep now:
1. Iterates through shards owned by this pod's replica group
2. Builds filter: _miroir_shard = {s} AND _miroir_expires_at <= {now_ms}
3. Issues DeleteByFilterRequest to target nodes with origin tagging
4. Tracks deleted documents via metrics

Acceptance criteria addressed:
- Documents with expired _miroir_expires_at are deleted via filter
- Field is stripped from responses (existing merger logic)
- Anti-entropy does not resurrect expired documents (existing logic)
- Metrics callback infrastructure in place

Closes: bf-450qf

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 13:21:33 -04:00
..
miroir-core feat(ttl): implement actual TTL sweep logic with NodeClient integration 2026-05-26 13:21:33 -04:00
miroir-ctl style: code formatting cleanup 2026-05-26 03:44:20 -04:00
miroir-proxy feat(ttl): implement actual TTL sweep logic with NodeClient integration 2026-05-26 13:21:33 -04:00