Coalescing per-PV pending-timestamp map shared between every
shard worker (incl. their spawn_blocking late-success closures)
and the single global flush owner.
Per-PV diagnostic counters for the BPL drop / rate / connection
reports. All counts are monotonic across the PV’s lifetime; the
rate handlers compute deltas against first_event_unix_secs.
Tunables for write_loop_with_config. Production uses the
defaults via write_loop; tests dial the timeouts down to
sub-second values so failure-injection cases finish in a few
hundred milliseconds instead of minutes.
Run an N-shard write pool: 1 dispatcher (hashes pv_name → shard)
plus N parallel write_loop_with_config workers. Each shard has
independent ts_updates, an independent flush ticker, and its
own per-PV writer slots inside the shared storage plugin (so
per-PV ordering is naturally preserved by the consistent-hash
routing — samples for one PV always go to the same shard).