fix(memory): Add missing fields in connection memory (#2306)

While at it, fix initialization of replication info, to correctly
account for replication connections.
This commit is contained in:
Shahar Mike 2023-12-17 10:37:35 +02:00 committed by GitHub
parent bd3e57d262
commit a98ba6a0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 15 deletions

View file

@ -191,14 +191,6 @@ ConnectionMemoryUsage GetConnectionMemoryUsage(ServerFamily* server) {
mems[thread_index].replication_connection_size += usage.mem;
mems[thread_index].replication_memory += usage.buf_mem;
}
if (cntx != nullptr) {
mems[thread_index].pipelined_bytes +=
cntx->conn_state.exec_info.body.capacity() * sizeof(StoredCmd);
for (const auto& pipeline : cntx->conn_state.exec_info.body) {
mems[thread_index].pipelined_bytes += pipeline.UsedHeapMemory();
}
}
});
}