Skip to content

Commit

Permalink
fix cases order
Browse files Browse the repository at this point in the history
Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark committed May 31, 2024
1 parent 794263e commit c1699fc
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions pkg/stanza/fileconsumer/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,18 @@ The net effect of the shut down routine is that all files are checkpointed in a

#### Supported cases

A) When a file it rotated out of pattern via move/create, we detect that
A) When a file is moved within the pattern with unread logs on the end, then the original is created again,
we get the unread logs on the moved as well as any new logs written to the newly created file.

B) When a file is copied within the pattern with unread logs on the end, then the original is truncated,
we get the unread logs on the copy as well as any new logs written to the truncated file.

C) When a file it rotated out of pattern via move/create, we detect that
our old handle is still valid and we attempt to read from it.
B) When a file it rotated out of pattern via copy/truncate, we detect that

D) When a file it rotated out of pattern via copy/truncate, we detect that
our old handle is invalid and we do not attempt to read from it.
C) When a file is copied within the pattern with unread logs on the end, then the original is truncated,
we get the unread logs on the copy as well as any new logs written to the truncated file
D) When a file is moved within the pattern with unread logs on the end, then the original is created again,
we get the unread logs on the moved as well as any new logs written to the newly created file


#### Rotated files that end up within the matching pattern

Expand All @@ -231,11 +235,11 @@ new reader.

#### Rotated files that end up out of the matching pattern

In case of a file has been rotated with move/create, the old handle will be pointing
to the moved file so we can still consume from it even if it's out of the pattern.
In case of the file has been rotated with copy/truncate, the old handle will be pointing
to the original file which is truncated. So we don't have a handle so as to consume any remaining
to the original file which is truncated. So we don't have a handle in order to consume any remaining
logs from the moved file. This can cause data loss.
In case of the file has been rotated with move/create, the old handle will be pointing
to the moved file so we can still consume from it even if it's out of the pattern.

# Known Limitations

Expand Down

0 comments on commit c1699fc

Please sign in to comment.