[pgpool-hackers: 204] Re: Ideas for code cleanup

Bruce Momjian bruce at momjian.us
Fri Apr 12 00:42:59 JST 2013


On Fri, Apr 12, 2013 at 12:32:10AM +0900, Tatsuo Ishii wrote:
> >> OK, I will send that as a separate email.
> > 
> > Looking at the code, there are 42 C files at the top level.  It seems
> > moving these to subdirctories would help --- suggestions:
> > 
> > proto - for libpq protocol handling
> > ipc - for shared memory, semaphores, and signals
> > rewrite - for query walking and rewriting
> > config - for config file handling
> > socket - for network handling
> 
> Let me think this.

Yes, I understand.  My guess is that once I am done the code will be
laid out file-wise much differently, which will cause existing
developers to have to learn a new layout.  However, i find that is minor
compared to the value of a cleaner layout that will attract new
developers.  I had to do this with pg_upgrade --- new developers have
had little problem updating pg_upgrade.

> > Also, it seems main.c should be broken into several files for config
> > file, ipc, and child process handling.  
> 
> In addition to this health checking part should be a separate process
> like pool_worker_child.c.

Good point.  I am thinking we can remove the pool_ prefix as well with
the new directory layout.

> > The goal is to allow the code to be more easily understood by new
> > developers.  Would you like to see a patch?
> 
> Yes, please. Maybe you want to start from breaking main.c into several
> files?

Sure. I will do that now and post a patch.

-- 
  Bruce Momjian  <bruce at momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


More information about the pgpool-hackers mailing list