Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fixing the summary serialization issue for cache RCAs #348

Merged
merged 2 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,19 @@ public ResourceFlowUnit<HotNodeSummary> operate() {
cacheEvictionCollector.collect(currTimestamp);
if (counter >= rcaPeriod) {
ResourceContext context;
HotNodeSummary nodeSummary;

InstanceDetails instanceDetails = getInstanceDetails();
HotNodeSummary nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());
Copy link
Contributor

Choose a reason for hiding this comment

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

So is the problem here a null HotNodeSummary ? Can we add UTs for a case where only few (or no) nodes have an issue?


double fieldDataCacheMaxSizeInBytes = getCacheMaxSize(
getAppContext(), new NodeKey(instanceDetails), ResourceUtil.FIELD_DATA_CACHE_MAX_SIZE);
Boolean exceedsSizeThreshold = isSizeThresholdExceeded(
fieldDataCacheSizeGroupByOperation, fieldDataCacheMaxSizeInBytes, cacheSizeThreshold);
if (cacheEvictionCollector.isUnhealthy(currTimestamp) && exceedsSizeThreshold) {
context = new ResourceContext(Resources.State.UNHEALTHY);
nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());
nodeSummary.appendNestedSummary(cacheEvictionCollector.generateSummary(currTimestamp));
}
else {
context = new ResourceContext(Resources.State.HEALTHY);
nodeSummary = null;
}

counter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public ResourceFlowUnit operate() {
cacheHitCollector.collect(currTimestamp);
if (counter >= rcaPeriod) {
ResourceContext context;
HotNodeSummary nodeSummary;

InstanceDetails instanceDetails = getInstanceDetails();
HotNodeSummary nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());

double shardRequestCacheMaxSizeInBytes = getCacheMaxSize(
getAppContext(), new NodeKey(instanceDetails), ResourceUtil.SHARD_REQUEST_CACHE_MAX_SIZE);
Boolean exceedsSizeThreshold = isSizeThresholdExceeded(
Expand All @@ -138,11 +138,9 @@ public ResourceFlowUnit operate() {
&& cacheHitCollector.isUnhealthy(currTimestamp)
&& exceedsSizeThreshold) {
context = new ResourceContext(Resources.State.UNHEALTHY);
nodeSummary = new HotNodeSummary(instanceDetails.getInstanceId(), instanceDetails.getInstanceIp());
nodeSummary.appendNestedSummary(cacheEvictionCollector.generateSummary(currTimestamp));
} else {
context = new ResourceContext(Resources.State.HEALTHY);
nodeSummary = null;
}

counter = 0;
Expand Down