Skip to content

Conversation

nikhilbonte21
Copy link

No description provided.

sriram-atlan and others added 20 commits September 15, 2025 15:20
…tency

Mlh 1240 custom metadata consistency
MLH-1275 remove other redis implementations
@nikhilbonte21 nikhilbonte21 merged commit b28155c into staging Sep 19, 2025
2 of 7 checks passed
int counter = 0;

while (currentSize != expectedFieldKeys && counter++ < totalIterationsAllowed) {
while (currentSize < expectedFieldKeys && counter++ < totalIterationsAllowed) {
Copy link

Choose a reason for hiding this comment

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

Bug: Type-Def Cache Timeout and Loop Condition Issues

The type-def cache refresh may time out prematurely because totalIterationsAllowed is hardcoded to 5, resulting in a 2.5-second wait instead of the intended 5 seconds. Additionally, the while loop condition changed from != to <, which means the refresh no longer waits or detects if the field key count exceeds the expected value.

Fix in Cursor Fix in Web

CURRENT_CLASSIFICATION_TYPEDEF_INTERNAL_VERSION = Long.parseLong(redisService.getValue(Constants.TYPEDEF_CLASSIFICATION_METADATA_CACHE_LATEST_VERSION, "1"));
CURRENT_STRUCT_TYPEDEF_INTERNAL_VERSION = Long.parseLong(redisService.getValue(Constants.TYPEDEF_STRUCT_CACHE_LATEST_VERSION, "1"));
CURRENT_ENTITY_TYPEDEF_INTERNAL_VERSION = Long.parseLong(redisService.getValue(Constants.TYPEDEF_ENTITY_CACHE_LATEST_VERSION, "1"));
CURRENT_RELATIONSHIP_TYPEDEF_INTERNAL_VERSION = Long.parseLong(redisService.getValue(Constants.TYPEDEF_RELATIONSHIP_CACHE_LATEST_VERSION, "1"));
Copy link

Choose a reason for hiding this comment

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

Bug: High Availability Mode Initialization Bug

Static typedef internal version variables are only initialized from Redis when HA is disabled. In HA mode, they remain 0, leading to incorrect version comparisons and cache refresh logic failures. The initialization of these static variables also lacks synchronization, which could cause race conditions if init() is called concurrently.

Fix in Cursor Fix in Web

getLogger().error("Redis getValue operation failed for key: {}", key, e);
throw e;
}
}
Copy link

Choose a reason for hiding this comment

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

Bug: Method Fails Safe Fallback, Causes Duplicate Metrics

The getValue(key, defaultValue) method re-throws exceptions instead of returning the defaultValue when an error occurs, defeating its purpose as a safe fallback. This also leads to duplicated metric recording and error logging, as the inner getValue(key) call already handles these.

Fix in Cursor Fix in Web

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