Skip to content

Fix CIDR trie lookups honoring TTLs (7.0) - #26955

Open
graylog-internal-actions-access[bot] wants to merge 1 commit into
7.0from
backport-7.0/fix/cidr-trie-lookup-honors-ttl
Open

Fix CIDR trie lookups honoring TTLs (7.0)#26955
graylog-internal-actions-access[bot] wants to merge 1 commit into
7.0from
backport-7.0/fix/cidr-trie-lookup-honors-ttl

Conversation

@graylog-internal-actions-access

Copy link
Copy Markdown

Note: This is a backport of #26854 to 7.0.

Description

Change default behavior of CIDRPatriciaTrie.longestPrefixRangeLookup to use now as the lookup time so that entries added with a TTL that has expired are properly ignored after expiry. Currently, only the enterprise MongoDBDataAdapter is affected (CSVFileDataAdapter entries cannot be added with a TTL) and the trie is automatically refreshed every hour, so an entry can only ever be at max 1 hour expired, but that's a long time. This change makes the expiry immediate.

Motivation and Context

Respect TTL for values added to a MongoDBDataAdapter

How Has This Been Tested?

unit tests

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

* Fix CIDR trie lookups honoring TTLs

* changelog

(cherry picked from commit 725feeb)

@ryan-carroll-graylog ryan-carroll-graylog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and tests successfully on 7.0: https://enterprise-pr-15162.dev.torch.sh/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants