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

Cache TTLs for individual IP addresses in DNS responses. #6732

Merged
merged 14 commits into from
Nov 5, 2024

Commits on Oct 29, 2024

  1. This patch enables the caching of TTLs for individual IPs in DNS resp…

    …onses.
    
    - Implement tracking of individual IP TTLs for FQDNs in the DNS cache.
    - Upon expiration of an IP's TTL, trigger a new DNS query.
    - Evict only those IPs that are no longer present in the latest DNS response and have exceeded their original TTL.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    e98030f View commit details
    Browse the repository at this point in the history
  2. Added clock field of type clock.Clock in fqdnController type.

     - Replace time.Now() usages with the clock set in fqdnController.
     - Inject fakeClock for tests.
    Removed mockDnsQueryQueue implementation.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    fe43d74 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Enable caching of individual IP TTLs in DNS responses and add clock s…

    …upport
    
    - Implement tracking of TTLs for individual IPs linked to FQDNs in the DNS cache.
    - Automatically trigger a new DNS query when an IP's TTL expires.
    - Evict only those IPs that are no longer present in the latest DNS response and have surpassed their original TTL.
    - Added clock field of type clock.Clock in fqdnController.
    - Pass clock while initializing fqdn controller.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    a22bef9 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'cache-individual-ip-ttl' of https://github.com/hkiiita/…

    …antrea into cache-individual-ip-ttl
    hkiiita committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    d8fe685 View commit details
    Browse the repository at this point in the history
  3. group antrea imports

    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    8b05b7e View commit details
    Browse the repository at this point in the history
  4. fix imports using golangci-fix

    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    2822742 View commit details
    Browse the repository at this point in the history
  5. rephrase various comments as per review and correct poll time in even…

    …tuality test to 1 second
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    8a03d3a View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2024

  1. Refactored newFQDNController() to pass a clock to the DNS query workq…

    …ueue.
    
    Updated onDNSResponse() to requeue DNS queries even when same IPs are receieved in a response.
    Added and updated comments as per review.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    cfcc0e0 View commit details
    Browse the repository at this point in the history
  2. correct grouping of imports in test file.

    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Oct 31, 2024
    Configuration menu
    Copy the full SHA
    e3e25df View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2024

  1. Updated clock parameter to type clock.WithTicket for newFQDNController.

    Updated comment clarifying the case when ipWithExpirationMap is of zero length in onDNSResponse.
    Updated test case which ensures the requery time to be the later time amongst the TTL already cached and TTL received in DNS response for cases involving same IPs, as present in DNS cache, being received.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Nov 1, 2024
    Configuration menu
    Copy the full SHA
    505616c View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2024

  1. removed type assertion for clock parameter in test.

    regplaced dnsQueryQueue.AddAfter logic as before.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    0753a33 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. Refactor import organization to separate local antrea.io/antrea impor…

    …ts from external imports
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    c217871 View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Fix the race condition between DelayingQueue and fakeClock in TestOnD…

    …NSResponse test.
    
    - Seemingly a race condition between the event of creation of Timer by DelayeingQueue and Step function of fakeClock is failing the test.
    - The fix Uses the idea in antrea-io#6407
    - The fix uses the ,already implemented wrapper, around fakeClock with a method that counts the number of times DelayedQueue's Timer has been called.
    
    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    6c6e6f2 View commit details
    Browse the repository at this point in the history
  2. Refactor require.Eventually to a one-liner for consistency

    Signed-off-by: Hemant <hkbiet@gmail.com>
    hkiiita committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    f939732 View commit details
    Browse the repository at this point in the history