Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74009

Add an LRU cache to limit the frequency of logging client metadata

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • Internal Code
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2023-03-06

    Description

      ClientCache implements an LRU cache and acts as the gatekeeper for logging client metadata for incoming gRPC streams. This ticket focuses on using the existing LRUCache to implement a thread-safe ClientCache, where:

      • The constructor forwards the maximum cache size to the constructor of LRUCache. By default, we will set this to 65,536, reserving about 1 MB of memory for the cache.
      • The add method inserts clientId into the underlying cache:
      • If the clientId already exists, the cache is updated and the add method returns false.
      • Otherwise, it returns true.

      class ClientCache {
      	explicit ClientCache(size_t maxSize);
      	bool add(const UUID& clientId) = 0;
      };
      

      Attachments

        Activity

          People

            patrick.freed@mongodb.com Patrick Freed
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: