This message was deleted.
# troubleshooting
s
This message was deleted.
r
I was using 4, now I've set it to 2
but I'm trying again with just one subtask as well, now it's seems to be working, but I changed too many variables at once
it's currenly on partial_range_index_generate
it's not using more than 3gb of memory, so I think I could have more workers
s
So it passed the distribution step? I was thinking you were likely running out of memory if you had overcommitted memory.
How much memory on the MM node? Anything else running on the node?
r
Copy code
resources:
        requests:
          cpu: "2"
          memory: 5.7Gi
        limits:
          memory: 12Gi
the node has s-8vcpu-16gb but is shared with other process like historicals, brokers, etc but in theory, when k8s send a kill signal if the node pressured, it send to the entire pod, not just to one container, muhc less just one jvm process
s
That’s for each MM and you have 4. At the limit it would mean 12x4 48gb. Or am I misunderstanding and each MM runs on a diff node?
r
I will wait this compaction finishes before changing anything, I tried adding 4 new nodes (dedicated to MM) and having 7 instances, set the max subtask 16 earlier, but it just create one task with 4 subtasks
the limit/request is for each instance (pod) each pod is now with 2 workers so in theory is: 512 for the main process +( Xmx 1322 + MaxDirectMemorySize 3g ) * 2 workers
the MaxDirectMemorySize is not used 100% of the time, and I was fine before with just 1G, but I the this very high number just to check
the pod is killed if the pod uses more than the limits but a kill can also happen if the node is under pressure (eg: 99% usage on the host)
s
I see. When the JVM fails, can you capture the core dump?
Were the nodes themselves reporting high memory usage?
Its recommended that you set -Xms equal to Xmx. I don’t know if that will help. Perhaps it surfaces the problem earlier.
r
I don't saw a JVM fail in this case, just this log about it going to shut down
s
Maybe we’re barking up the wrong tree. That’s an info message. Could this just be a normal finish of the task and the problem was in starting the next phase?
Anything on the overlord log?
r
I'll wait this task finishes, then look into separating the ingestion MM and the compactions tasks into different tiers
because each time I change the config, the queries temporary return wrong results (nothing too critical, but still) and I can be fine with a smaller setup for the ingestion, and a bigger memory for the compation tier
s
Sounds like a plan. Good luck. Let us know how it goes.
If you have any incorrect result please let us know.
r
thank you, I'll keep you all updated!
half step done - updated the k8s deploy to taint a pool and added 2 nodes dedicated to compression now I'm trying to find where to set the both the auto compaction job
druid.worker.category
never mind, my search abilities may be worse on notebook, now I found it on https://druid.apache.org/docs/0.22.0/configuration/index.html#affinity
s
😎
That’s really cool, I was unaware of that functionality. Sounds like you can map the compact tasks for a data source to the tier.
r
so, I never used it, but in theory I knew it was possible
Copy code
{
  "type": "equalDistributionWithCategorySpec",
  "workerCategorySpec": {
    "strong": false,
    "categoryMap": {
      "index_kafka": {
        "defaultCategory": "_default_worker_category"
      },
      "partial_dimension_distribution": {
        "defaultCategory": "unzipperman"
      },
      "partial_range_index_generate": {
        "defaultCategory": "unzipperman"
      },
      "partial_index_generic_merge": {
        "defaultCategory": "unzipperman"
      }
    }
  }
}
I'm trying with this config right now
I think it's working (I've killed all the index_kafka it was running on the "unzipperman" node's)
now I'm awaiting for the compaction task
s
Isn’t there also a task type “compact”?
r
oh, I hope it goes into the default as well
let's see haha
s
😁
r
compaction went to the "unzipperman" tier, but I think I was 'by chance', that's wasteful as this task is just doing supervisor and do not run anything itself
s
True.
r
the compaction jobs throw some errors while the subtask is doing IO (download the segment)
Copy code
2023-03-17T21:23:02,627 INFO [ServiceClientFactory-0] org.apache.druid.rpc.ServiceClientImpl - Service [overlord] request [GET <http://10.244.3.35:8088/druid/indexer/v1/task/partial_range_index_generate_GL_ALL_MSG_SERVER_TIME_hcapdifm_2023-03-17T21%3A22%3A54.539Z/reports>] completed.
2023-03-17T21:23:02,628 WARN [qtp1619129136-174] org.apache.druid.indexing.common.task.batch.parallel.ParallelIndexSupervisorTask - Encountered exception when getting live subtask report for task: partial_range_index_generate_GL_ALL_MSG_SERVER_TIME_hcapdifm_2023-03-17T21:22:54.539Z
java.lang.NullPointerException: null
maybe I need to increase some parameter on the peon. I'm already using
druid.server.http.numThreads=60
(which is a lot, I think, given I have only 2 brokers, each using druid.broker.http.numConnections=10)
but the task compaction keep trying again, so it's going
giving it a lot of memory worked!
s
Yeah, that should be plenty of http threads. Glad you figured it out. How high did the memory usage get? On the MMs?
r
when both slots were busy running partial_index_generic_merge it hit 6200mb
-Xms1024M -Xmx1024M -XX:MaxDirectMemorySize=2g
current peon config druid.indexer.fork.property.druid.processing.numMergeBuffers=1 druid.indexer.fork.property.druid.processing.buffer.sizeBytes=450MiB druid.indexer.fork.property.druid.processing.numThreads=2
s
So you ended up reducing the peon settings. Hmmm… that would imply that it was over extending the pod resources. The lack of Errors is weird.
r
now I have a harder question, what's happen to all the segments that was uploaded but the tasks failed? is there any cleanup script or step when any processes go up? I probably have a few thousand files orphan in the deep storage, given this was running and failing for ~ 1 year
v
I m curious doesn’t deep storage have any life cycle policy if its cloud based?
r
I've set no life cycle nor versioning, as I expect that druid do all the version control I think DigitalOcean Spaces do not even have any way of doing it
I was reading the logs, I think the file name is different, it begins with 'partial_'
I need to write some code to list all files and print to a file, so I can grep how many of them exists
Hmm, I think druid do not do any cleanup when druid.coordinator.kill.on is off, not even after the compaction I maybe I should had it set to 'dropExisting: true' during the compaction jobs
s
In order to get cleanup on Deep Storage you need to run kill tasks. The druid.coordinator.kill.on=true, does this automatically. It will remove "unused" segments, those that have been dropped (drop retention rule) or overshadowed. I'm not sure about partial files...
r
I have this option turned off, because I want to keep the data unload for most of the time, if I turn the auto kill, it will remove both the overshadow and the current version of those segments I still did not tested the delete, but I think it should exists an option to issue kill tasks only from the used period, but maybe this is not necessary if the dropExisting in ioConfig during is safe to use (it's marked as beta on https://druid.apache.org/docs/latest/data-management/compaction.html) If this option is safe, and drop only the previous segments version, then the kill task over the load period would not be necessary
LOL, now I'm getting out of memory (both heap/and-or Direct) on the regular indexing_kafka let me check what was the config before I think I've increase the XMX, and that somehow make it make bad assumptions and now it's crashing (well, it worked fine for 2 days, but started failing to publish today)
even with just 20MB * ram, druid still do 5~7k/rows per second, on shared cpu on digital ocean (flushing to nvme disks) *20mb for maxBytesInMemory
s
maxBytesInMemory
drives intermediate persists. Intermediate persists are local to the MM, they take the in-memory row buffer and write it out locally to disk in segment format. But is this happened during the publishing stage of the tasks? What does your data look like? Do you have a large number of columns? The segment merge step that occurs before publishing can use significant amount of memory. To mitigate, you can set
maxColumnsToMerge
to reduce the memory footprint while merging columns or reduce the
maxRowsPerSegment
so that overall dataset is smaller when publishing.
r
first they fail with heap, I think it's probability because I was (before Friday) using
-Xms512M -Xmx1024M -XX:MaxDirectMemorySize=1g
for all middlemanagers. I was having issues with compaction not finishing ever (I was assuming the failures of the tasks were always because of them losing their locking, but I was wrong) Then I did a few tests and ended up with two sets of middlemanagers, one for the kafka ingestions and another set to make the compactions, durign this change, I accidentally reduced from 512mb~1GB to a fixed Xms512M. Now I changed back to
-Xms640m -Xmx640m -XX:MaxDirectMemorySize=3g
The max rows was set to 100,000 (probably did not hit in one-task-duration during normal ops) but the maxMemory was set to zero, so it was 1/6 (~ 85mb), when I set maxMemory to 20mb just to check without changing the DirectMem It failed during the final phase, before publishing. The numMergeBuffers=2, sizeBytes=150MiB and numThreads=2 was kept always fixed, using the formula this was theoretically 750mb (where the limit was 1gb when the task was failing with DirectMem errors), I set a big value just because this node is big (16gb) and usually is running with 4 slots at 6GB. Most of the ingestions are very very low volume (like, 1 record a hour), that's why I want so many small workers Now with 20mb every task finished successfully since 5~ hours ago
compaction is working as well, before I was with dealing with ~ 170 segments each day for this datasource in red (since I spotted the issue with the compaction task failing due to the heap, and also started dropping late messages over 21 days, or 3 days for the less important ones, I still need to make a queue to send all late messages at once daily, so autocompaction can work without interruptions)
oh, about the number of the columns, it's about ~ 88, avro encoded they weight about 400 bytes, most of them are then encoded with low card strings (fake booleans), 34 of then are
long
s
Sounds like you figured it all out. Nice!