Skip to content

Log files with same inode number in different block Device caused missing log file #4326

Open
@mioyui88

Description

@mioyui88

Describe the bug

I have two log files in different block device. Two log files have same file name and same inode number.

The first file with inode 17 in device fh72h/64882d 
stat /var/lib/kubelet/pods/pod-uid-1/volumes/kubernetes.io~csi/local-pv-id-1/mount/xx/xx/file.log
       Device: fh72h/64882d                 Inode:17 

The second file with inode 17 in device fd53h/64851d 
stat /var/lib/kubelet/pods/pod-uid-2/volumes/kubernetes.io~csi/local-pv-id-2/mount/xx/xx/file.log
       Device: fd53h/64851d                 Inode:17 

When I want collect the two file.log, I find fluentd only collect one file, the other one doesn't show the fluentd tail target and existing list.

tailing paths: target =  /var/lib/kubelet/pods/pod-uid-1/volumes/kubernetes.io~csi/local-pv-id-1/mount/xx/xx/file.log |
  existing = /var/lib/kubelet/pods/pod-uid-1/volumes/kubernetes.io~csi/local-pv-id-1/mount/xx/xx/file.log

To Reproduce

  1. mount two block device to different mountpoint
  2. cd mountpoint, make new file, I think default inode number is same
  3. start fluentd , set config follow_inodes true

Expected behavior

Fluentd can identify inode number in different block device, and collect log.

Your Environment

- Fluentd version:1.16.2
- TD Agent version:
- Operating system: Centos7
- Kernel version:3.10.0-1160.92.1.el7.x86_64

Your Configuration

<source>
  @type tail
  read_from_head true
  skip_refresh_on_startup true
  path /var/lib/kubelet/pods/*/volumes/kubernetes.io~csi/*/mount/namespace/*/*/*.log
  pos_file /var/log/csi_namespace.log.pos
  refresh_interval 5s
  tag "csi_namespace"
  limit_recently_modified 7d
  format /?<message>.*/
</source>

Your Error Log

There is no error log, just can't get the log. And Fluentd print existing just include one log file.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementFeature request or improve operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions