Skip to content

Commit dfda963

Browse files
Log last failed memory allocation instead of max (#12981)
1 parent 2edc9b5 commit dfda963

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ydb/core/kqp/rm_service/kqp_rm_service.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class TTxState : public TAtomicRefCount<TTxState> {
163163
res << ", tx initially granted memory: " << HumanReadableSize(TxExternalDataQueryMemory.load(), SF_BYTES)
164164
<< ", tx total memory allocations: " << HumanReadableSize(TxScanQueryMemory.load(), SF_BYTES)
165165
<< ", tx largest successful memory allocation: " << HumanReadableSize(TxMaxAllocation.load(), SF_BYTES)
166-
<< ", tx largest failed memory allocation: " << HumanReadableSize(TxFailedAllocation.load(), SF_BYTES)
166+
<< ", tx last failed memory allocation: " << HumanReadableSize(TxFailedAllocation.load(), SF_BYTES)
167167
<< ", tx total execution units: " << TxExecutionUnits.load()
168168
<< ", started at: " << CreatedAt
169169
<< " }" << Endl;
@@ -184,11 +184,11 @@ class TTxState : public TAtomicRefCount<TTxState> {
184184

185185
void AckFailedMemoryAlloc(ui64 memory) {
186186
auto* oldBacktrace = TxFailedAllocationBacktrace.load();
187-
ui64 maxAlloc = TxFailedAllocation.load();
187+
ui64 lastAlloc = TxFailedAllocation.load();
188188
bool exchanged = false;
189189

190-
while(maxAlloc < memory && !exchanged) {
191-
exchanged = TxFailedAllocation.compare_exchange_weak(maxAlloc, memory);
190+
while(!exchanged) {
191+
exchanged = TxFailedAllocation.compare_exchange_weak(lastAlloc, memory);
192192
}
193193

194194
if (exchanged) {

0 commit comments

Comments
 (0)