vectordotdev / vectordotdev/vector
NATS source declares can_acknowledge() = true while its docs declare acknowledgements: no, suppressing the end-to-end acknowledgement warning
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
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
- A
natssource in JetStream mode feeding any sink withacknowledgements: enabled: true(config below). - Start Vector and read the boot log.
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/sources/nats/config.rs around NatsSourceConfig::can_acknowledge() and inspect build(), then trace propagate_acknowledgements() in src/config/mod.rs. Reproduce the JetStream configuration with an acknowledgement-enabled sink and verify that the completed change causes the documented non-acknowledgement warning to appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability, stream-processing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100