Process a batch of Normal-mode events: trigger batching, CDC, permission cache, streaming MVs, CRDT sync. Statement-level trigger dispatch is per-event (no batching).
(
events: &[super::types::WriteEvent],
shared_state: &Arc<SharedState>,
retry_queue: &mut TriggerRetryQueue,
cdc_router: &Arc<super::cdc::CdcRouter>,
_slab_account: &Arc<super::sla
| 356 | /// Process a batch of Normal-mode events: trigger batching, CDC, permission cache, |
| 357 | /// streaming MVs, CRDT sync. Statement-level trigger dispatch is per-event (no batching). |
| 358 | async fn process_normal_batch( |
| 359 | events: &[super::types::WriteEvent], |
| 360 | shared_state: &Arc<SharedState>, |
| 361 | retry_queue: &mut TriggerRetryQueue, |
| 362 | cdc_router: &Arc<super::cdc::CdcRouter>, |
| 363 | _slab_account: &Arc<super::slab_budget::ConsumerSlabAccount>, |
| 364 | ) { |
| 365 | let mut trigger_collector = |
| 366 | crate::control::trigger::batch::collector::TriggerBatchCollector::new( |
| 367 | crate::control::trigger::batch::BatchConfig::default().batch_size, |
| 368 | ); |
| 369 | |
| 370 | for event in events { |
| 371 | if !event.op.is_data_event() { |
| 372 | shared_state |
| 373 | .watermark_tracker |
| 374 | .advance_lsn_only(event.vshard_id.as_u32(), event.lsn.as_u64()); |
| 375 | continue; |
| 376 | } |
| 377 | |
| 378 | // DML audit: record to audit log before dispatching triggers. |
| 379 | super::audit_dml::audit_dml_event(event, shared_state); |
| 380 | |
| 381 | if let Some(batch) = |
| 382 | accumulate_data_event(event, shared_state, &mut trigger_collector, cdc_router) |
| 383 | { |
| 384 | super::trigger::dispatcher::dispatch_trigger_batch(&batch, shared_state, retry_queue) |
| 385 | .await; |
| 386 | } |
| 387 | |
| 388 | super::trigger::dispatcher::dispatch_triggers(event, shared_state, retry_queue).await; |
| 389 | } |
| 390 | |
| 391 | if let Some(batch) = trigger_collector.flush() { |
| 392 | super::trigger::dispatcher::dispatch_trigger_batch(&batch, shared_state, retry_queue).await; |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | /// Process the retry queue: DLQ exhausted entries and retry ready ones. |
| 397 | async fn process_retry_queue( |
no test coverage detected