mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-14 14:56:54 +00:00
## Summary - Add post-flush dirty-window notifications for metric writes through `PendingRowsBatcher`, so batching-mode flows are updated when Prometheus remote write uses the pending-row batcher path. - Notifications fire only after the entire physical flush succeeds; failed flushes (including partial region failures) send no notification. Notification errors are best-effort and never affect the persisted write result. - Optimize timestamp extraction with a null-free fast path (`extend_from_slice(values())`) and a nullable fallback (`iter().flatten()`). - Refactor notifier to take ownership of `Vec<TableBatch>`, eliminating the per-flush vector clone. - Key `PendingBatch` by logical `TableId` to prevent same-name drop/recreate merging within one flush interval. ## Known follow-ups (from self-review) - Per-peer `Vec<i64>` clone in notifier could use `Arc<Vec<i64>>`; intentionally deferred as the cost is negligible for typical peer counts. - No integration/sqlness test for end-to-end flow notification through the batcher. - Cache lookup `Err` path and multi-table flush path lack dedicated unit tests. ## Test Plan - [x] `cargo nextest run -p servers --lib --retries 0` — 293 tests pass - [x] `cargo fmt --all -- --check` - [x] `cargo check -p servers -p frontend -p operator -p tests-integration` - [x] `git diff --check`