-
Notifications
You must be signed in to change notification settings - Fork 546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add memory accounting for multi-phase execution #15968
Conversation
af054aa
to
4be60d8
Compare
f819681
to
b0e7963
Compare
server/src/main/java/io/crate/execution/MultiPhaseExecutor.java
Outdated
Show resolved
Hide resolved
I think we need a port to 5.7 and a change entry since OutOfMemory is a bug in general? Even if only new change exposed it, there can be another scenarios causing it. |
b0e7963
to
fde5452
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, see also comment about treating it as a fix
var ramAccounting = ConcurrentRamAccounting.forCircuitBreaker( | ||
"multi-phase", | ||
executor.circuitBreaker(HierarchyCircuitBreakerService.QUERY), | ||
plannerContext.transactionContext().sessionSettings().memoryLimitInBytes() | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth checking performance impact of this - and if it's worth wrapping into BlockBasedRamAccounting
(but per consumer, further below) to reduce the amount of synchronization.
server/src/main/java/io/crate/execution/engine/FirstColumnConsumers.java
Outdated
Show resolved
Hide resolved
+1 |
@mfussenegger Performance-wise there is no difference but allocation seems less with ram accounting #15971
|
Is it worth also trying out the BlockBasedRamAccounting ? |
On the |
Ok, thanks! |
The BlockBasedRamAccounting makes a clear difference. I will continue in this direction. |
With block-ram-accounting against master:
Note: I don't expect that the block-ram-accounting does a speed against no accounting, this is probably a measurement failure, but it def. does not slows it down. |
0851460
to
f6695b9
Compare
01cd279
to
ab6ac29
Compare
f4aa81f
to
fae232c
Compare
server/src/test/java/io/crate/execution/engine/FirstColumnConsumersTest.java
Outdated
Show resolved
Hide resolved
fae232c
to
efd8fd2
Compare
Multi-Phase execution can produce large intermediate results which can cause out-of-memoryi errors. This adds memory accounting to prevent this.
efd8fd2
to
da11f75
Compare
Summary of the changes / Why this improves CrateDB
Multi-Phase execution can produce large intermediate results which can cause to run the node out-of-memory. This adds memory accounting to prevent this.
Follow-up for #15664
Checklist
docs/appendices/release-notes/<x.y.0>.rst
for user facing changessql_features
table for user facing changesdocs/appendices/release-notes/<x.y.0>.rst
(E.g. AdminUI)