-
Notifications
You must be signed in to change notification settings - Fork 58
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
sincedb: do not read entire line #51
Conversation
@buom thanks for noticing this bug. I'm just wondering why you reset the sincedb entry to 0 instead of removing the record from the sincedb. Any strong reason ? |
@wiibaa I works on filewatch 0.5.1 (ships w/ logstash 1.4.2) and I do not notice that the _sincedb_write function has changed (make temp file then rename to). |
@buom as your PR is targetting master can you make the change to |
@wiibaa updated |
LGTM |
sincedb: do not read entire line
@buom can you elaborate a bit more on the scenarios where you saw this issue? We now have noticed that it creates a bug where rotating a file through "mv" (like The reason for this PR was that after deleting a file and creating a new one, it could have the same inode thus making it "invisible" to filewatch. Is this correct, @buom ? |
@jsvd Yes, it is.
|
Not sure how to properly solve this. The issue this PR creates is quite bad as it doubles the data if logrotate does a |
@buom maybe we can detect on a new file, if there's an existing inode and the size differs from the new file, we reset that to zero? |
The issue occurs when we delete a file and then add a new one -- even if it has a different name -- it may well have the same inode number, and the File handler will think it is the same file. In this case we should reset the position to 0 (the old inode)