QuestDB JavaScript Client - v5.0.0
    Preparing search index...

    Interface QwpNodeStoreAndForwardOptions

    Node store-and-forward controls layered on the crash-safe replay journal.

    interface QwpNodeStoreAndForwardOptions {
        appendDeadlineMs?: number;
        backpressurePolicy?: QwpSfBackpressurePolicy;
        catchUpCapGapMinEscalationWindowMs?: number;
        checkpointIntervalMs?: number;
        directory: string;
        drainOrphans?: boolean;
        durability?: QwpSfDurability;
        initialConnectMode?: QwpInitialConnectMode;
        maxBackgroundDrainers?: number;
        maxBytes?: number;
        maxSegmentBytes?: number;
        onOrphanDrainEvent?: (event: QwpNodeOrphanDrainEvent) => void;
        onRecoveryDataLoss?: (report: QwpNodeReplayDataLossReport) => void;
        onRecoveryQuarantine?: (event: QwpNodeReplayRecoveryEvent) => void;
        orphanScanIntervalMs?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    appendDeadlineMs?: number

    Per-append capacity or retryable store-fault deadline. Defaults to 30 seconds.

    backpressurePolicy?: QwpSfBackpressurePolicy

    Behavior when maxBytes is exhausted. error fails immediately; wait pauses the append until ACK trimming frees space or its deadline expires. Defaults to error for backwards compatibility.

    This decides journal exhaustion only. A transient retryable fault parks until appendDeadlineMs under either policy, so the only errors an append surfaces are exhaustion and that deadline.

    catchUpCapGapMinEscalationWindowMs?: number

    Minimum time an orphan slot's symbol catch-up cap gap must persist before it is quarantined. The gap must also be observed 16 times. Defaults to five minutes; zero uses the observation threshold alone.

    checkpointIntervalMs?: number

    Periodic durability checkpoint cadence. Defaults to 5 seconds.

    directory: string

    Exclusive directory used by one ingress session.

    drainOrphans?: boolean

    Adopts sibling replay slots left by terminated producers. Standalone senders default this to false; pooled clients always recover their own idle in-range and out-of-range sender-N slots.

    durability?: QwpSfDurability

    Local persistence barrier. append preserves the existing fsync-per-frame behavior, periodic checkpoints dirty files in the background, and memory relies on OS page-cache writeback. Defaults to append.

    initialConnectMode?: QwpInitialConnectMode

    Initial server connection policy. Defaults to off; an explicitly tuned reconnect policy promotes it to sync, matching the Java client.

    maxBackgroundDrainers?: number

    Maximum sibling slots drained concurrently. Defaults to 4.

    maxBytes?: number

    Target maximum journal size including fixed segment reservations and symbol metadata. Defaults to 1 GiB. The current symbol dictionary may exceed this target so it cannot consume the journal's live frame budget before a drained close retires that dictionary generation.

    A commit whose deferred prefix already fills the journal also overshoots it, because QuestDB withholds that prefix's ACK until the commit arrives, so no amount of trimming could make room first. For fixed segment size S, reservations are capped at S * (floor(maxBytes / S) + max(floor(maxBytes / S), ceil(min(maxBytes, 32 MiB) / S))), saturated at Number.MAX_SAFE_INTEGER. The closing batch must fit the applicable standalone rounded segment allowance on its own. The retained dictionary is additive; beyond the cap appends backpressure. When S divides maxBytes exactly, this segment cap is 2 * maxBytes.

    Must reserve at least one whole segment -- maxSegmentBytes + 32 for the 24-byte SFA header and the 8-byte frame header. A smaller target throws a RangeError, because no append could ever reserve its first segment and no acknowledgement could ever free room for one.

    maxSegmentBytes?: number

    Maximum QWP frame payload and target segment data size. Each fixed segment reserves this value plus one record header and its 24-byte SFA header, so a maximum-sized frame still fits. Defaults to 4 MiB. With a directory, QwpNodeFileReplayStoreOptions.maxBytes must leave room for one whole segment of this size plus those 32 bytes of headers.

    onOrphanDrainEvent?: (event: QwpNodeOrphanDrainEvent) => void

    Receives isolated scanner, drainer, durable-ACK capability-gap, and primary-unavailable lifecycle notifications.

    onRecoveryDataLoss?: (report: QwpNodeReplayDataLossReport) => void

    Reports journal bytes abandoned during recovery. Defaults to logging at error level; recovery still succeeds, so this must never be silent.

    onRecoveryQuarantine?: (event: QwpNodeReplayRecoveryEvent) => void

    Receives a data-loss notification when corrupt foreground replay bytes are preserved under an .unreplayable-N pathname and a fresh slot is opened.

    orphanScanIntervalMs?: number

    Periodic rescan cadence; zero disables the timer. Pooled ownership changes can still trigger a scan. Defaults to 30 seconds. Capped at 2,147,483,647ms (the host timer ceiling); a larger value throws a RangeError.