!495 [I2AMGW] When multiple coordinators are used, don't update memory pool info if work is not scheduled on coordinator
Merge pull request !495 from Arven/fix-ha-cn-memory-pool
This commit is contained in:
commit
7eb2fcfece
|
|
@ -531,23 +531,24 @@ public class ClusterMemoryManager
|
|||
|
||||
// Add new nodes
|
||||
for (InternalNode node : aliveNodes) {
|
||||
if (!nodes.containsKey(node.getNodeIdentifier())) {
|
||||
if (!nodes.containsKey(node.getNodeIdentifier()) && shouldIncludeNode(node)) {
|
||||
nodes.put(node.getNodeIdentifier(), new RemoteNodeMemory(node, httpClient, memoryInfoCodec, assignmentsRequestCodec, locationFactory.createMemoryInfoLocation(node), isBinaryEncoding));
|
||||
}
|
||||
}
|
||||
|
||||
// If work isn't scheduled on the coordinator (the current node) there is no point
|
||||
// in polling or updating (when moving queries to the reserved pool) its memory pools
|
||||
if (!isWorkScheduledOnCoordinator) {
|
||||
nodes.remove(nodeManager.getCurrentNode().getNodeIdentifier());
|
||||
}
|
||||
|
||||
// Schedule refresh
|
||||
for (RemoteNodeMemory node : nodes.values()) {
|
||||
node.asyncRefresh(assignments);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldIncludeNode(InternalNode node)
|
||||
{
|
||||
// If work isn't scheduled on the coordinator (the current node) there is no point
|
||||
// in polling or updating (when moving queries to the reserved pool) its memory pools
|
||||
return isWorkScheduledOnCoordinator || !node.isCoordinator();
|
||||
}
|
||||
|
||||
private synchronized void updatePools(Map<MemoryPoolId, Integer> queryCounts)
|
||||
{
|
||||
// Update view of cluster memory and pools
|
||||
|
|
|
|||
Loading…
Reference in New Issue