#33873 [Bug]: spend-log batches are permanently dropped when a database write fails
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate
### What happened?
Spend-log batches are removed from the in-memory queue before their database write succeeds. When the write fails after retries, or raises a non-retryable system error, the batch is not restored and is permanently lost
`ProxyUpdateSpend.update_spend_logs` slices up to 10,000 entries from `prisma_client.spend_log_transactions` and immediately replaces the queue with the remaining entries before performing any write in [`update_spend_logs`](https://github.com/BerriAI/litellm/blob/3f9b71c1a45e870d1789ee105bd59b9274bb0d74/litellm/proxy/utils.py#L5171-L5252). Its outer exception handler explicitly says not to put the logs back, then re-raises through `_raise_failed_update_spend_exception`
The main production caller removes the batch a second way: [`update_spend_logs_job`](https://github.com/BerriAI/litellm/blob/3f9b71c1a45e870d1789ee105bd59b9274bb0d74/litellm/proxy/utils.py#L5357-L5387) pops under the queue lock, then passes the detached list to `update_spend_logs`. If that call raises, the queue monitor catches the exception and continues, but the…