Skip to content

Commit

Permalink
Revert "temp: Add temporary monitoring for large memcache keys (#36034)…
Browse files Browse the repository at this point in the history
…" (#36040)

This reverts commit fb56042. We have the data we need.
  • Loading branch information
timmc-edx authored Dec 17, 2024
1 parent 5bf0b27 commit f0eb0da
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions common/djangoapps/util/memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from django.conf import settings
from django.utils.encoding import smart_str
from edx_django_utils.monitoring.utils import increment


def fasthash(string):
Expand Down Expand Up @@ -49,18 +48,9 @@ def safe_key(key, key_prefix, version):
# Attempt to combine the prefix, version, and key
combined = ":".join([key_prefix, version, key])

# Temporary: Add observability to large-key hashing to help us
# understand the safety of a cutover from md4 to blake2b hashing.
# See https://github.com/edx/edx-arch-experiments/issues/872
increment('memcache.safe_key.called')

# If the total length is too long for memcache, hash it
if len(combined) > 250:
combined = fasthash(combined)
# Temporary: See
# https://github.com/edx/edx-arch-experiments/issues/872 and
# previous comment.
increment('memcache.safe_key.hash_large')

# Return the result
return combined

0 comments on commit f0eb0da

Please sign in to comment.