Skip to content

fix(logstash source): fix partial window ack boundaries#25616

Draft
emilychendd wants to merge 1 commit into
masterfrom
codex/logstash-partial-window-ack
Draft

fix(logstash source): fix partial window ack boundaries#25616
emilychendd wants to merge 1 commit into
masterfrom
codex/logstash-partial-window-ack

Conversation

@emilychendd

@emilychendd emilychendd commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the logstash source ACK path for a coalesced Lumberjack batch where a fresh WindowSize arrives before the previous partial writer window has been acknowledged.

The prior #25531 fix preserved completed writer-window boundaries, but a partial window followed by a fresh window in the same ReadyFrames batch could still emit only the later ACK, for example [4] instead of [2, 4]. Filebeat can treat that as invalid sequence number received because the ACK advances past the current pending send.

This change carries the prior partial-window ACK boundary through the decoder and emits it only when the predecessor frame is present in the same ReadyFrames batch, avoiding duplicate ACKs when the previous partial tail was already ACKable in an earlier batch.

Vector configuration

N/A

How did you test this PR?

Unit tests included. Triggering this is highly timing dependent.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@github-actions github-actions Bot added the domain: sources Anything related to the Vector's sources label Jun 12, 2026
@emilychendd emilychendd changed the title [codex] fix logstash partial window ack boundaries fix(logstash source): fix partial window ack boundaries Jun 12, 2026
@emilychendd emilychendd force-pushed the codex/logstash-partial-window-ack branch from f4dc04d to 1e78ace Compare June 12, 2026 20:29

@bruceg bruceg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. All of this special-casing to work around ReadyFrames makes me really wonder if that is the right abstraction for this source, but that's a refactor for another day.

Comment thread src/sources/logstash.rs
Comment on lines +1116 to +1119
push_window_size(&mut req, 4);
push_req(&mut req, 1, &[("message", "first partial window first")]);
push_req(&mut req, 2, &[("message", "first partial window second")]);
push_window_size(&mut req, 4);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads like a protocol violation, but I suppose it's possible, so… 🤷🏻

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm good point.... probably not the cause of the problem for the case we are looking at 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants