Fix Telemetry: Tasks are serialized to the wrong store when using separate stores for telemetry and data

This commit is contained in:
Maurus Decimus
2026-07-20 11:35:46 +02:00
parent 3cc348726b
commit 2553d8ee4c
5 changed files with 59 additions and 18 deletions

View File

@@ -652,6 +652,26 @@ impl Store {
!matches!(self, Self::None)
}
pub fn is_same(&self, other: &Store) -> bool {
match (self, other) {
#[cfg(feature = "sqlite")]
(Store::SQLite(a), Store::SQLite(b)) => Arc::ptr_eq(a, b),
#[cfg(feature = "foundation")]
(Store::FoundationDb(a), Store::FoundationDb(b)) => Arc::ptr_eq(a, b),
#[cfg(feature = "postgres")]
(Store::PostgreSQL(a), Store::PostgreSQL(b)) => Arc::ptr_eq(a, b),
#[cfg(feature = "mysql")]
(Store::MySQL(a), Store::MySQL(b)) => Arc::ptr_eq(a, b),
#[cfg(feature = "rocks")]
(Store::RocksDb(a), Store::RocksDb(b)) => Arc::ptr_eq(a, b),
(Store::Ephemeral(a), Store::Ephemeral(b)) => Arc::ptr_eq(a, b),
#[cfg(all(feature = "enterprise", any(feature = "postgres", feature = "mysql")))]
(Store::SQLReadReplica(a), Store::SQLReadReplica(b)) => Arc::ptr_eq(a, b),
(Store::None, Store::None) => true,
_ => false,
}
}
#[inline(always)]
pub fn is_sql(&self) -> bool {
match self {