Advance the expiry wheel and reap expired keys. Call this from the TPC core's event loop at the configured tick interval. Returns a list of `(tenant_id, collection, key)` for each reaped key, enabling the caller to produce WAL tombstones and CDC/keyspace events.
(&mut self, now_ms: u64)
| 54 | /// Returns a list of `(tenant_id, collection, key)` for each reaped key, |
| 55 | /// enabling the caller to produce WAL tombstones and CDC/keyspace events. |
| 56 | pub fn tick_expiry(&mut self, now_ms: u64) -> Vec<ExpiredKey> { |
| 57 | let batch = self.expiry.tick(now_ms); |
| 58 | let mut reaped = Vec::new(); |
| 59 | |
| 60 | for (composite_key, expire_at_ms) in &batch.expired { |
| 61 | if let Some((tid, collection, key)) = parse_expiry_key(composite_key) |
| 62 | && let Some(table) = self.tables.get_mut(&table_key(tid, &collection)) |
| 63 | && table.reap_expired(&key, *expire_at_ms) |
| 64 | { |
| 65 | reaped.push(ExpiredKey { |
| 66 | tenant_id: tid, |
| 67 | collection, |
| 68 | key, |
| 69 | }); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | reaped |
| 74 | } |
| 75 | |
| 76 | /// Number of entries tracked in the expiry wheel. |
| 77 | pub fn expiry_queue_depth(&self) -> usize { |