Skip to content

2024.2.1.0-b32

Summary:
######Backport Description
Minor merge conflicts in yb_virtual_wal_client.c due to `foreach_delete_current` not being present.

######Original Description
This diff fixes two memory leaks in walsender:

  # In ybccmds `YBCGetRelfileNodes()` allocates memory to store relfilenodes and returns the pointer to this allocated memory. In the current implementation we did not free this memory after use. This has been fixed in this diff.

  # In yb_virtual_wal_client `CleanupAckedTransactions()`, we delete the entries from `unacked_transactions` list with commit_lsn <= confirmed_flush_lsn. Memory is allocated for each transaction when its commit is shipped. This allocation is done on `YB unacked txn list context` and an element pointing to this memory is added to unacked_transactions list. Upon receiving an acknowledgement from client for a particular txn, its entry is deleted from the unacked_transactions list using `foreach_delete_current` (which is equivalent to `list_delete_cell()`). However `list_delete_cell()` does not clean up the memory pointed to by the entry being deleted. This caused the memory leak. It was observed in the QA stress runs that memory allocations on `YB unacked txn list context` increased linearly with time and this memory usage did not go down even after streaming was caught up. This diff fixes this memory leak by explicitly free-ing the memory pointed to by the entry in unacked_transactions list at the time of its deletion

Original commit: 90a56a618f89ac49e3be9e4943525845c524cf47 / D39837
Jira: DB-13887

Test Plan:
Jenkins: urgent
QA tests

Reviewers: siddharth.shah, skumar, stiwary, aagrawal

Reviewed By: siddharth.shah

Subscribers: yql, ycdcxcluster

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D39839
Assets 2
Loading