Skip to content

Fix metaGetPerClient#185

Merged
shy-1234 merged 1 commit intomasterfrom
dev/sh/fixmetagetperclient
Mar 3, 2026
Merged

Fix metaGetPerClient#185
shy-1234 merged 1 commit intomasterfrom
dev/sh/fixmetagetperclient

Conversation

@shy-1234
Copy link
Contributor

This PR aims to fix two things:

  1. wrong key was used to get the primary node: Depending on isOriginalKeyHashed is true or false, the key that is actually searched in getEVCacheItem() can be different from the key that has been passed in. This can result in wrong node info being returned. One example: metaGetPerClient(originalKey, tc, false) will return {the node searched using originalKey : the value searched using hash(originalKey)}
  2. Weird retry logic: There seemed to be a retry logic when instancesWithNull.size() > 0 && map.size() > 0, meaning that we found the derivedKey on one or some of the replica(s), but failed on some. In this case, the logic was to utilize the value that was found (using the KEY we passed in) and extract the originalKey from the value if it's a EVCacheValue (meaning that it was hashed by the client). Then use the originalKey from the value to search again. The logic was introduced in this commit and I might be missing some context.. However, I don't know why we are doing it this way..

Assuming originalKeyB was hashed to hashedKeyA and someone is trying to search for the value using either of the key:

  • metaGetPerClient(hashedKeyA, isOriginalKeyHashed=true) --> retrieve value using hashedKeyA --> extract originalKeyB from value --> isn't hash(originalKeyB) == hashedKeyA?
  • metaGetPerClient(hashedKeyA, isOriginalKeyHashed=false) --> retrieve unrelated value if exist using hash(hashedKeyA) --> extract originalKeyC from the unrelated value -> why retry on hash(originalKeyC)?
  • metaGetPerClient(originalKeyB, isOriginalKeyHashed=false) --> retrieve value using hash(originalKeyB) --> extract originalKeyB from value --> isn't hash(originalKeyB) == hash(originalKeyB)?
  • metaGetPerClient(originalKeyB, isOriginalKeyHashed=true) --> retrieve unrelated value if exist using originalKeyB --> extract originalKeyD from the unrelated value --> Why retry on originalKeyD?

@shy-1234 shy-1234 merged commit 08542e9 into master Mar 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants