litellm/litellm/proxy/db/db_transaction_queue
ryan-crabbe-berri 5eff708d0f fix(proxy): keep persisted spend another pod has not incremented in the window seed
The batch start told the seed which LiteLLM_SpendLogs rows were its own, but
using it as a hard cutoff also dropped rows another pod had already persisted.
Those rows are only repaid by that pod's own increment, so if it died first the
window row stayed permanently under the recorded spend.

The seed now reads both sums in one scan and takes off this batch's own spend,
flooring at the pre-batch total for the case where its log rows have not landed
yet. Redis payloads keep an empty request_ids so a leader from before the field
was dropped can still merge what it pops during a rolling deploy.

Claude-Session: https://claude.ai/code/session_01QvQzYztinxj8ZuD5YxbVdL
2026-08-31 15:49:03 -07:00
..
base_update_queue.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
daily_spend_update_queue.py feat(spend): report prompt caching savings as total and gateway-attributed (#38134) 2026-08-28 00:19:06 -07:00
pod_lock_manager.py fix(alerting): dedupe scheduled Slack spend reports across pods (#36489) 2026-08-11 12:41:11 -07:00
redis_update_buffer.py fix(proxy): keep persisted spend another pod has not incremented in the window seed 2026-08-31 15:49:03 -07:00
spend_log_cleanup.py feat(proxy): add maximum_health_check_retention_period to bound the health-check table (#37681) 2026-08-20 16:01:16 -07:00
spend_log_cleanup_metrics.py perf(spend-logs): bound retention cleanup so one run cannot saturate the database (#36594) 2026-08-13 18:56:37 -07:00
spend_logs_partition_manager.py perf(spend-logs): bound retention cleanup so one run cannot saturate the database (#36594) 2026-08-13 18:56:37 -07:00
spend_update_queue.py feat(budgets): enforce shared budgets on model access groups 2026-08-29 12:13:55 -07:00
tool_discovery_queue.py feat(lint): enforce Final on locals and freeze function parameters (LIT010, LIT011) 2026-08-04 12:54:39 -07:00
window_spend_update_queue.py fix(proxy): keep persisted spend another pod has not incremented in the window seed 2026-08-31 15:49:03 -07:00