NATS source declares can_acknowledge() = true while its docs declare acknowledgements: no, suppressing the end-to-end acknowledgement warning

Aperta Adatta ai principianti
#26,345 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Inizia da src/sources/nats/config.rs intorno a NatsSourceConfig::can_acknowledge() e ispeziona build(), quindi segui propagate_acknowledgements() in src/config/mod.rs. Riproduci la configurazione JetStream con un sink per il quale gli acknowledgement sono abilitati e verifica che la modifica completata faccia comparire l’avviso documentato relativo all’assenza di acknowledgement.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

source:nats
A note for the community
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Problem

The NATS source reference documents acknowledgements: no, and that matches the implementation: run_nats_jetstream calls msg.ack() as soon as send_batch has handed the events into the topology channel, and no BatchNotifier appears in the file.

But NatsSourceConfig::can_acknowledge() returns true unconditionally (src/sources/nats/config.rs ~279-282), while build() never calls cx.do_acknowledgements(...).

As a result, propagate_acknowledgements() (src/config/mod.rs ~213-246, warning at ~241) skips the warning it emits for non-acknowledging sources:

Source has acknowledgements enabled by a sink, but acknowledgements are not supported by this source. Silent data loss could occur.

So a JetStream source feeding a sink with acknowledgements: enabled: true boots clean, with nothing indicating the guarantee is absent.

Reproduce

  1. A nats source in JetStream mode feeding any sink with acknowledgements: enabled: true (config below).
  2. Start Vector and read the boot log.
  3. Expected: the warning above, per the documented acknowledgements: no. Actual: no warning.

Suggested fix: make can_acknowledge() reflect what is implemented — false, or self.jetstream.is_some() once the source actually participates. PR #26217 contains this narrowing as part of a much larger change; this issue asks for it on its own, so operators on released versions get the warning the framework is designed to give them.

Configuration
sources:
  nats_in:
    type: nats
    url: nats://127.0.0.1:4222
    subject: test.>
    connection_name: ack-warning-repro
    jetstream:
      stream: TEST
      consumer: test-consumer

sinks:
  out:
    type: blackhole
    inputs: [nats_in]
    acknowledgements:
      enabled: true
Version

0.54.0

Debug Output

Example Data

No response

Additional Context

Found while assessing end-to-end delivery guarantees for a compliance-relevant data path, where we needed to know whether an acknowledgement-enabled sink gave us anything on a JetStream source. It does not — which the documentation states plainly, and which we accept. The problem is only that the code claims otherwise and therefore silences the one warning that would have told us. We are not asking for the acknowledgement feature in this issue.

Docs page showing acknowledgements: no: https://vector.dev/docs/reference/configuration/sources/nats/

References

PR #26217 — adds end-to-end acknowledgement support to the NATS source and includes the same can_acknowledge() narrowing as part of a larger change. Open, draft, unreviewed at the time of writing. This issue is deliberately narrower and independent of whether that PR proceeds.

Lingua principale
Rust
Stelle
22.8k
Fork
2.4k
Merge medio
1g 13h
PR unite (30g)
273

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vectordotdev/vector

Tutte le issue di vectordotdev/vector

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.