On Sun, Jun 9, 2013 at 10:25 PM, Noah Misch <noah@leadboat.com> wrote:
- Test recovery, such as by running a streaming replica under Memcheck while the primary runs "make installcheck-world".
In general we need a lot more testing on the recovery code.
- Memcheck has support for detecting leaks. I have not explored that side at all, always passing --leak-check=no. We could add support for freeing "everything" at process exit, thereby making the leak detection meaningful.
I think this is missing the type of leaks we actually care about. The way palloc works we can be virtually certain that if we did that we wouldn't have any leaks. All it would detect are the random one-off mallocs we know very well are there.
The problems we've had with leaks in the past are invariably things allocated at the "wrong" memory context. Things that can grow for every row processed but are stored per-query or for every query processed but stored per-sesson. To detect that will requires more of a heuristic where when a child memory context is reset any parent context growth is logged.