I am running dgraph on kubernetes cluster. I am able to successfully upload large data
(140k quads) using dgraph live command.
chart_version = dgraph-0.0.19
App version = v21.12.0
kubernetes pod memory = 200Mi limit.
Here when I try to delete the uploaded file data, using the query below, the dgraph alpha pods run out of memory and go in crash loop. On each restart after sometime the error is displayed as follows:
The node was low on resource: memory. Container test-dgraph-dgraph-alpha was using 3172816Ki, which exceeds its request of 200Mi.
This keeps on increasing on subsequent restarts. Also the memory usage of the pod which is 200Mi increases.
The schema structure is one Project type which is connected to all other types( which are around 15 types) with a reverse project edge.
Delete query:
upsert {
query {
var(func: uid(0x67d6b3)) { #here the uid is of project type
p_uid as uid
~project {
s_uid as uid
}
}
}
mutation {
delete {
uid(p_uid) * * .
uid(s_uid) * * .
}
}
}
We also tried upgrading the chart version to 0.0.20 and App version v22.0.2, which gave the following error
Error: cannot patch "test-dgraph-dgraph-ratel" with kind Deployment: Deployment.apps "test-dgraph-dgraph-ratel" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"dgraph", "chart":"dgraph-0.0.20", "component":"ratel", "release":"test-dgraph"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable && cannot patch "test-dgraph-dgraph-alpha" with kind StatefulSet: StatefulSet.apps "test-dgraph-dgraph-alpha" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden && cannot patch "test-dgraph-dgraph-zero" with kind StatefulSet: StatefulSet.apps "test-dgraph-dgraph-zero" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
Can you help me with what can be the reason of increasing memory usage? Or any suggestions for the delete query.
And also how to resolve the upgrade error.