Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-4052

Simplify/Remove double delete/lookup in heartbeat cleanup code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.1, 2.6.2
    • 2.6.3
    • None
    • None

    Description

      This changes slightly simplifies the heartbeat cleanup code so it no longer tries to delete the heartbeat files twice. It also removes an unneeded directory listing (and possible race) by truncating the versions list and using it for removal instead of for keeping.

      Removing the double delete attempt is important because it removes a lookup for now non-existent files. Looking up non existent files, especially highly unique (like timestamped) ones can adversely affect many operating systems as these lookups are cached as negative dentries.
      https://lwn.net/Articles/814535/

      When cleanup runs, it iterates over the heartbeat directory that contains a token and version file for each heartbeat. It calls deleteVersion for each file in the directory which attempts to delete both files associated with the heartbeat. As deleteVersion already deletes both when it first iterates over the token file, the iteration for the version file has nothing to do.

      Before removing, the deleteVersion code checks for the existence of these now non existent files. On linux (and other OSs) a lookup for a non-existent path will create a negative dentry in the operating system's cache. On some configurations this cache can grow effectively unbounded leading to performance issues. On newer systems this cache is better managed, but this will still dilute an otherwise useful OS cache with useless entries.

       

      Copied from https://github.com/apache/storm/pull/3635 (Author: sammac)

       

       

       

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            rzo1 Richard Zowalla
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m