use xattr to trace file instead of inode #62
+32
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we trace file with inode, it will confuse sincedb if filesystem reuse an inode, which cause the file truncated random
https://logstash.jira.com/browse/LOGSTASH-685
Since we hard to prevent filesystem reuse a inode, we could use another fileId like windows did
http://stackoverflow.com/questions/16069898/can-inode-and-crtime-be-used-as-a-unique-file-identifier
As you know, most modern filesystem support
Extended File Attributes
, we could generate a UUID for file and store it in xattrs, which will associated with inodes (files, directories, symlinks, etc).https://en.wikipedia.org/wiki/Extended_file_attributes
http://manpages.ubuntu.com/manpages/precise/man2/getxattr.2.html