fix(localdb): adapter review fixes — deterministic pump teardown, always-hosted initiator, backoff clamp

Claude-Session: https://claude.ai/code/session_01BL2Vu1ESDQ9SCN4gVKkdts
This commit is contained in:
Joseph Doherty
2026-07-17 23:13:02 -04:00
parent a64fc26391
commit e92cdc6d3a
6 changed files with 148 additions and 28 deletions
@@ -10,6 +10,16 @@ namespace ZB.MOM.WW.LocalDb.Replication.Internal;
/// </summary>
internal static class SyncSessionFactory
{
/// <summary>
/// The engine binds to <see cref="SqliteLocalDb"/> internals (NodeId, Clock, replicated-table
/// digests), so both adapters require the concrete type AddZbLocalDb registers behind ILocalDb.
/// </summary>
public static SqliteLocalDb RequireSqlite(ILocalDb db, string consumer) =>
db as SqliteLocalDb
?? throw new InvalidOperationException(
$"{consumer} requires the ILocalDb registered by AddZbLocalDb (a {nameof(SqliteLocalDb)}); " +
$"got {db.GetType().FullName}.");
public static SyncSession Create(SqliteLocalDb db, ReplicationOptions options, ILoggerFactory loggerFactory)
{
var store = new OplogStore(db, options);