1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: Apache-2.0
//! Shared failure policy for durable outbound-queue enqueues.
use crateLiteError;
/// Apply the outbound-enqueue failure policy to a write that has already
/// committed to the local store.
///
/// `Backpressure` is the single fatal class: the durable outbound queue is
/// full, so the local write must be rejected and surfaced to the caller for
/// retry — otherwise the local store would silently diverge from the replica.
/// Every other enqueue error is non-fatal: the row is already durable locally
/// and will reconcile on the next full resync, so it is logged and swallowed.
///
/// Centralising this here keeps the fatal-vs-recoverable decision in one place;
/// every write path (vector, document, columnar, timeseries — via either the
/// trait-impl or the physical-visitor adapters) routes its enqueue result
/// through this function instead of repeating the `matches!`/`warn!` dance.
///
/// `op` / `collection` / `id` are recorded on the warning for diagnosis; pass an
/// empty `id` for collection-level operations that have no per-row identity.
///
/// Returns the original `LiteError` on backpressure so callers can propagate it
/// directly (when their future is `Result<_, LiteError>`) or convert it with
/// `NodeDbError::storage` (when they return `NodeDbResult`).
pub