chore: improve DB flushing (#13620)

This branch:
* Avoid flushing DB when not necessary
* Filter events for which we perfom an `upsert` into the DB
* Add a dedicated update function of the `thread:updated_at` that is
lighter

This should significantly reduce the DB lock contention. If it is not
sufficient, we can de-sync the flush of the DB for `updated_at`
This commit is contained in:
jif-oai
2026-03-06 18:58:14 +00:00
committed by GitHub
Unverified
parent 4e6c6193a1
commit 0e41a5c4a8
6 changed files with 366 additions and 28 deletions
+1 -1
View File
@@ -1694,7 +1694,7 @@ impl Session {
self.services.state_db.clone()
}
/// Ensure all rollout writes are durably flushed.
/// Ensure rollout file writes are durably flushed.
pub(crate) async fn flush_rollout(&self) {
let recorder = {
let guard = self.services.rollout.lock().await;