Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(journald source): Cursor/checkpoint fixes #1106

Merged
merged 2 commits into from Oct 29, 2019
Merged

Conversation

bruceg
Copy link
Member

@bruceg bruceg commented Oct 28, 2019

This fixes a couple of issues with the journald source checkpoint handling discovered while dealing with #1097 / #1105.

  1. After restarting, the last handled record in the journal would be repeated due to a one-off bug in the cursor handling.
  2. The checkpoint is not updated during a stream of records, which could cause repeated records if Vector is interrupted.

The checkpoint value we store for journald sources is the cursor for the
most recently output record. This means, when we seek back to it, the
next record to be sourced will be duplicated from the previous run.

Instead, we either need to advance to the next record immediately after
restoring the cursor or before saving the cursor. The former is less
complex to implement.

Signed-off-by: Bruce Guenter <bruce@untroubled.org>
Previously, the journald source would not write out a checkpoint until
there were no new records left in the journal. In the event of an
interruptin during a long stretch of new records, this could cause
duplicated records.

This adds a batch limit to the reader so the checkpoint is updated at
least once per batch.

Signed-off-by: Bruce Guenter <bruce@untroubled.org>
@bruceg bruceg merged commit ddffd3b into master Oct 29, 2019
@bruceg bruceg deleted the journald-cursor-fixes branch October 29, 2019 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants