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

Reject chunks without timekey from candidates of destination of symlink #1234

Merged
merged 2 commits into from
Sep 20, 2016

Conversation

tagomoris
Copy link
Member

"symlink" feature is to link from symlink_path to the latest file chunk. Records with latest timekey will be appended into that file chunk.
On the other side, resumed file chunks might NOT have timekey, especially in the cases that resumed file chunks are generated by
Fluentd v0.12. These chunks will be enqueued immediately, and will be flushed soon.

So these files SHOULD NOT be a candidate of destination of symlink.

fixes #1219.

"symlink" feature is to link from symlink_path to the latest file chunk. Records with latest timekey will be appended into that file chunk.
On the other side, resumed file chunks might NOT have timekey, especially in the cases that resumed file chunks are generated by
Fluentd v0.12. These chunks will be enqueued immediately, and will be flushed soon.

So these files SHOULD NOT be a candidate of destination of symlink.
@tagomoris tagomoris added bug Something isn't working v0.14 labels Sep 13, 2016
@tagomoris
Copy link
Member Author

@repeatedly Could you review this change?

@@ -59,7 +59,7 @@ def symlink_path=(path)

def generate_chunk(metadata)
chunk = super
latest_chunk = metadata_list.sort_by(&:timekey).last
latest_chunk = metadata_list.select{|m| m.timekey }.sort_by(&:timekey).last
Copy link
Member

Choose a reason for hiding this comment

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

Add comment is better for understanding why we pick up only chunks which have timekey data.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment.

@repeatedly
Copy link
Member

LGTM

@tagomoris tagomoris merged commit 83afab1 into master Sep 20, 2016
@tagomoris tagomoris deleted the fix-bug-for-symlink-and-existing-file-chunk branch September 20, 2016 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v0.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

comparison of NilClass with 1473379200 failed
2 participants