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

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

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Service Arch
    • Fully Compatible
    • Service Arch 2023-03-06

      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;
      };
      

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

              Created:
              Updated:
              Resolved: