Flush oldest sink when total rows in all sinks exceeds maxRowsInMemory#2459
Flush oldest sink when total rows in all sinks exceeds maxRowsInMemory#2459navis wants to merge 6 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
its already volatile, do we really need to take a swaplock here ?
There was a problem hiding this comment.
If index can be null, it's not safe to do something like return index != null && index.canAppendRow(). I thought the overhead is minimal. But volatile needed to be removed then.
4f657aa to
3840815
Compare
|
@navis how did you create so many sinks at the same time without triggering maxPendingPersists to begin throttling ingestion? |
|
@fjy I've used a day log file in local filesystem with hour segment granularity. Any of row count for an hour didn't exceeded I know it's not general use cases and we can pass it with lower |
|
@gianm do you mind taking a look? |
There was a problem hiding this comment.
Maybe this is unnecessary/unrealistic, but should this be determined based on the configured maxRowsInMemory? i.e., if the user configures maxRowsInMemory < 100000, they could in theory run into the same OOM issue.
Perhaps this isn't a practical problem though unless the per-row size is colossal and/or available memory is tiny.
There was a problem hiding this comment.
Changed to Math.min(config.getMaxRowsInMemory() >> 2, MAX_ROW_EXCEED_CHECK_COUNT). Thanks.
3840815 to
011fc93
Compare
20eac31 to
44586bc
Compare
44586bc to
dad4608
Compare
dad4608 to
a4b2847
Compare
There was a problem hiding this comment.
This file doesn't need to change
|
@navis, this looks like a great change that would make druid easier to configure. my main comments are #2459 (comment) & #2459 (comment). |
|
@gianm Because currently we are not using any kind of realtime ingestion (it's very very bad part of our on-going projects) and don't have a chance to apply this, it seemed not good idea for me to make patchs for this kind of issues. I'm good to this to be assigned by someone or to be closed with 'later' state. |
|
I'm removing the milestone for now based on author's comments. |
|
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@druid.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Currently
maxRowsInMemoryin RealtimeIndexTask is applied per sink base, which can cause OOM if too many sinks under the size of the threshold are created for some reason. This patch periodically checks total count of currently active sinks and persist the least recently accessed one if it exceeds the threshold.