SingleStore DB

Enable Core Dumps

Core dumps can be enabled on individual pods, or across all pods.

Individual Pods
  1. List all pods in the cluster.

    kubectl get pods -l app.kubernetes.io/name=memsql-cluster,app.kubernetes.io/instance=<cluster-name>
    
  2. Confirm that a core dump will be produced upon crash.

    kubectl exec <pod-name> -c node -- memsqlctl query --sql "SELECT @@core_file"
    ****
    +-------------+
    | @@core_file |
    +-------------+
    | 1           |
    +-------------+
    

    The default value for @@core_file is 1, which indicates that creating a core dump on crash is enabled. If this value is 0, creating a core dump on crash is disabled. To enable it, run the following command.

    kubectl exec <pod-name> -c node -- memsqlctl -y update-config --key core_file --value ON
    

    Restart the node for this change to take effect.

    kubectl exec <pod-name> -c node -- memsqlctl -y restart-node
    
  3. Configure the core dump to be either partial or full. By default, a partial core dump is created. Refer to the core_file_modeengine variable for more information on partial and full core dumps.

    Run the following command to check the current value.

    kubectl exec node-memsql-cluster-master-0 -c node -- memsqlctl query --sql "SELECT @@core_file_mode"
    ****
    +------------------+
    | @@core_file_mode |
    +------------------+
    | PARTIAL          |
    +------------------+
    

    Run the following command to change this value.

    For a partial core dump:

    kubectl exec <pod-namne> -c node -- memsqlctl -y update-config --key core_file_mode --value PARTIAL
    

    For a full core dump:

    kubectl exec <pod-name> -c node -- memsqlctl -y update-config --key core_file_mode --value FULL
    

    Restart the node for this change to take effect.

    kubectl exec <pod-name> -c node -- memsqlctl -y restart-node
    
Across all Pods
  1. To make the above core dump changes across all pods, add the following subsection to the memsql-cluster.yaml file’s spec section. Refer to the core_file_mode engine variable for more information on partial and full core dumps.

    globalVariables:
      core_file: "ON"
      core_file_mode: "FULL"    # or "PARTIAL", depending on your goal
    
  2. Apply these values to enable core dumps on all pods.

    kubectl apply -f memsql-cluster.yaml