Skip to content

Issue with Amazon Redshift patch 197

0

After update of Redshift with patch 197 we started getting issues with out of memory. We are moving data into Quicksight and some of the bigger datasets stopped working right after Maintenance updated the cluster to 1.0.166219 and patch 197.

Out Of Memory: code: 1004 context: alloc(16777216,MtExecPlanPoolCN) query: 166145258 location: xen_memory.cpp:1057 process: query0_101_166145258

Key parts from the message:

ERROR: Out of memory context: alloc(16777216,MtExecPlanPoolCN) process: query0_68_166015639

So, Redshift tried to allocate 16 MB more for the execution plan on one of the compute nodes and couldn’t.

We have at the moment 3 nodes.

We have now tried to add one more node but it still having the problem.

asked a year ago304 views

1 Answer
0

The issue you're experiencing with out of memory errors after updating to Redshift patch 197 is related to how Redshift manages memory allocation across your cluster nodes and slices.

When you scale a Redshift cluster (like adding a node as you did), the data distribution doesn't automatically rebalance optimally across all slices. This can lead to uneven workload distribution where some nodes are working much harder than others, potentially causing memory issues on the heavily loaded nodes.

Your error message "Out Of Memory: context: alloc(16777216,MtExecPlanPoolCN)" indicates that Redshift was trying to allocate 16MB for the execution plan on a compute node but couldn't find enough memory.

While adding a node did resolve your immediate issue, it's not the most cost-effective solution if the underlying problem is data distribution. Here are some steps you can take to optimize your cluster without necessarily keeping the extra node:

  1. Run VACUUM FULL followed by ANALYZE to reclaim space and update statistics

  2. Check for data distribution skew across your nodes and slices using system views like stv_slices and stv_blocklist

  3. For tables showing significant skew, consider recreating them with DISTSTYLE AUTO to let Redshift choose the optimal distribution style

  4. For large tables that are causing problems, try a deep copy operation to redistribute the data:

CREATE TABLE new_table DISTSTYLE AUTO AS SELECT * FROM original_table;
  1. Check if your Workload Management (WLM) configuration needs adjustment - WLM controls memory allocation to query slots

If these steps don't resolve the issue, the patch may have changed how memory is allocated in your specific configuration, and you might need to contact AWS Support for further assistance.
Sources
Redshift cluster uses only 6 of 8 slices after scaling from 2 to 4 nodes | AWS re:Post
WLM dynamic memory allocation - Amazon Redshift

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.