Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 243232 - Ebuild for dev-db/pgbouncer
Summary: Ebuild for dev-db/pgbouncer
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Aaron W. Swenson
URL: http://pgfoundry.org/projects/pgbouncer
Whiteboard: [sunrise-overlay]
Keywords: EBUILD, InOverlay
Depends on:
Blocks:
 
Reported: 2008-10-22 16:06 UTC by Mike Weissman
Modified: 2011-11-16 04:18 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild for version 1.2.3 (pgbouncer-1.2.3.ebuild,1.05 KB, text/plain)
2008-10-22 16:07 UTC, Mike Weissman
Details
auto-database patch (pgbouncer-auto-database.patch,7.89 KB, patch)
2008-10-22 16:08 UTC, Mike Weissman
Details | Diff
ebuild for version 1.2.3 (pgbouncer-1.2.3.ebuild,1.21 KB, text/plain)
2008-10-22 18:03 UTC, Mike Weissman
Details
updated for new init.d script (pgbouncer-1.2.3.ebuild,1.13 KB, text/plain)
2008-10-22 20:17 UTC, Mike Weissman
Details
init.d script (pgbouncer-1.2.3,1007 bytes, text/plain)
2008-10-22 20:18 UTC, Mike Weissman
Details
updated ebuild (pgbouncer-1.2.3-r1.ebuild,1.70 KB, text/plain)
2008-12-01 21:33 UTC, Mike Weissman
Details
init.d script (pgbouncer-1.2.3,1017 bytes, text/plain)
2008-12-01 21:33 UTC, Mike Weissman
Details
Updated Ebuild (pgbouncer-1.2.3-r1.ebuild,1.70 KB, text/plain)
2008-12-01 21:36 UTC, Mike Weissman
Details
pgbouncer 1.3 (pgbouncer-1.3.ebuild,1.49 KB, text/plain)
2009-04-01 21:05 UTC, Johan Bergström
Details
Updated ebuild (pgbouncer-1.3.ebuild,1.51 KB, text/plain)
2009-05-11 09:50 UTC, Johan Bergström
Details
pgbouncer-1.4.2.ebuild (pgbouncer-1.4.2.ebuild,1.58 KB, text/plain)
2011-11-14 12:27 UTC, Johan Bergström
Details
pgbouncer.initd (pgbouncer.initd,714 bytes, text/plain)
2011-11-14 12:29 UTC, Johan Bergström
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Weissman 2008-10-22 16:06:43 UTC
Ebuild request for PgBouncer, which is a Lightweight connection pooler for PostgreSQL.

== Features ==

 * Several levels of brutality when rotating connections:

  Session pooling::
        Most polite method.  When client connects, a server connection
        will be assigned to it for the whole duration it stays connected.
        When client disconnects, the server connection will be put back
        into pool.

  Transaction pooling::
        Server connection is assigned to client only during a transaction.
        When !PgBouncer notices that transaction is over, the server
        will be put back into pool.  This is a hack as it breaks application
        expectations of backend connection.  You can use it only when
        application cooperates with such usage by not using features
        that can break.  See the table below for breaking features.

  Statement pooling::
        Most aggressive method.  This is transaction pooling with a twist -
        multi-statement transactions are disallowed.  This is meant to enforce
        "autocommit" mode on client, mostly targeted for PL/Proxy.

 * Low memory requirements (2k per connection by default).  This is due
 to the fact that !PgBouncer does not need to see full packet at once.

 * It is not tied to one backend server, the destination databases can
 reside on different hosts.

 * Supports online reconfiguration for most of the settings.

 * Supports online restart/upgrade without dropping client connections.

 * Supports protocol V3 only, so backend version must be >= 7.4.




Reproducible: Always
Comment 1 Mike Weissman 2008-10-22 16:07:29 UTC
Created attachment 169434 [details]
ebuild for version 1.2.3

works on PSQL-8.4.3 on x86 and sparc.
Comment 2 Mike Weissman 2008-10-22 16:08:11 UTC
Created attachment 169436 [details, diff]
auto-database patch

patch to avoid having to manually enter database servers.
Comment 3 Mike Weissman 2008-10-22 18:03:50 UTC
Created attachment 169456 [details]
ebuild for version 1.2.3

few changes added debug USE
Comment 4 Mike Weissman 2008-10-22 20:17:09 UTC
Created attachment 169484 [details]
updated for new init.d script
Comment 5 Mike Weissman 2008-10-22 20:18:05 UTC
Created attachment 169486 [details]
init.d script
Comment 6 Johan Bergström 2008-11-25 09:33:05 UTC
Hey! Thanks a bunch for your ebuild. I would really like to see this in the tree as well, not sure about the patch though. I think similar feature enhancements should go through the "normal procedure" - sending a patch to the pgbouncer developers and let it merge upstream (which is on its way as far as the patch info on pgfoundry tells me)

A couple of minor remarks from my point of view:
(* Remove the auto-database.patch)
 * How about wrapping --enable-cassert with the debug flag?
 * Your indentation in both init.d and the ebuild is a bit messed up
 * add the ~amd64 keyword (works fine here with postgresql 8.3.4)
 * Don't remove the pid in start() - that's what Gentoo's init system is for
 * Do we really want to use the postgres user for pgbouncer? postgres owns a lot of files that pgbouncer has nothing to do with - as a proxy, I'm inclined to let it sit in its own user/group

Again, this is a very nice addition to portage - thanks for your time!
 
Comment 7 Mike Weissman 2008-11-25 16:21:02 UTC
(In reply to comment #6)
> A couple of minor remarks from my point of view:
> (* Remove the auto-database.patch)
>  * How about wrapping --enable-cassert with the debug flag?
>  * Your indentation in both init.d and the ebuild is a bit messed up
>  * add the ~amd64 keyword (works fine here with postgresql 8.3.4)
>  * Don't remove the pid in start() - that's what Gentoo's init system is for
>  * Do we really want to use the postgres user for pgbouncer? postgres owns a
> lot of files that pgbouncer has nothing to do with - as a proxy, I'm inclined
> to let it sit in its own user/group
> 
> Again, this is a very nice addition to portage - thanks for your time!
> 
> 

The Upstream knows about the patch, they have taken a look at it:
http://pgfoundry.org/tracker/index.php?func=detail&aid=1010460&group_id=1000258&atid=985

Yea i agree, about wrapping the debug flags into 1 use, i'll do that.

Yea i noticed that indentation issue on my other computer, i'll have to re-do it there.

I'll take a look at the init script, but i think on one of my servers i had an issue with pid files. 

The reason i ran it as postgres user, is that it saves a lot of tinkering with permissions( a few a+rw) , configuration, and it makes it not very "working out of the box" esk, but that just my opinion.  Since there isn't a lot of documentation of this software, i thought keeping it simple would make it more likely for people to want to use it.


I'll submit an updated ebuild, when i am finished revising it. 

-Mike 
Comment 8 Mike Weissman 2008-12-01 21:33:37 UTC
Created attachment 174004 [details]
updated ebuild

updated the ebuild and init.d script based on suggestions.
Comment 9 Mike Weissman 2008-12-01 21:33:57 UTC
Created attachment 174005 [details]
init.d script
Comment 10 Mike Weissman 2008-12-01 21:36:25 UTC
Created attachment 174006 [details]
Updated Ebuild
Comment 11 Johan Bergström 2009-04-01 21:05:57 UTC
Created attachment 187023 [details]
pgbouncer 1.3

Pgbouncer 1.3 has been out a while.

Updated ebuild with following changes:
 * version bump
 * changed download path (can't figure out a generic pgfoundry download path)
 * removed commented out patch (merged upstream)
 * changed depend to virtual/postgresql-base since -server on the same computer isn't needed.
 * changed name of init script to ${PN} (skipping version)
 * remove eautoreconf since i didn't have any autotools issues on any of my testbeds - please re-add if necessary

The init file should be renamed pgbouncer-1.3 ; otherwise its good to go. I guess one could move some minor things from the init script to conf.d or something - but it works as intended.
Comment 12 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-04-28 15:35:59 UTC
(this is an automated message based on filtering criteria that matched this bug)
'EBUILD' is in the KEYWORDS which should mean that there is a ebuild attached 
to this bug.
This bug is assigned to maintainer-wanted which means that it is not in the 
main tree.
Heuristics show that no Gentoo developer has commented on your ebuild.

Hello, The Gentoo Team would like to firstly thank you for your ebuild 
submission. We also apologize for not being able to accommodate you in a timely
manner. There are simply too many new packages.

Allow me to use this opportunity to introduce you to Gentoo Sunrise. The 
sunrise overlay[1] is a overlay for Gentoo which we allow trusted users to 
commit to and all users can have ebuilds reviewed by Gentoo devs for entry 
into the overlay. So, the sunrise team is suggesting that you look into this 
and submit your ebuild to the overlay where even *you* can commit to. =)

Because this is a mass message, we are also asking you to be patient with us. 
We anticipate a large number of requests in a short time. 

Thanks,
On behalf of the Gentoo Sunrise Team,
Jeremy.

[1]: http://www.gentoo.org/proj/en/sunrise/
[2]: http://overlays.gentoo.org/proj/sunrise/wiki/SunriseFaq
Comment 13 Johan Bergström 2009-05-11 09:50:32 UTC
Created attachment 190924 [details]
Updated ebuild

New version which fixes all warnings from repoman
Comment 14 Johan Bergström 2009-05-11 17:56:43 UTC
This ebuild is now in the gentoo-sunrise overlay: http://overlays.gentoo.org/proj/sunrise/browser/sunrise/dev-db/pgbouncer
Comment 15 Johan Bergström 2011-11-05 15:39:09 UTC
I would like to move this ebuild to the main tree. For me this has been a lifesaver multiple times, and out of the box usually gives a nice performance improvement (see for instance http://filip.rembialkowski.net/pgbouncer-mini-howto-benchmark/ ). 

Would the postgres herd possibly be interested in picking it up (i will gladly act as co-maintainer)?

Thanks
Comment 16 Aaron W. Swenson gentoo-dev 2011-11-12 14:57:07 UTC
(In reply to comment #15)
> I would like to move this ebuild to the main tree. For me this has been a
> lifesaver multiple times, and out of the box usually gives a nice performance
> improvement (see for instance
> http://filip.rembialkowski.net/pgbouncer-mini-howto-benchmark/ ). 
> 
> Would the postgres herd possibly be interested in picking it up (i will gladly
> act as co-maintainer)?
> 
> Thanks

Yes, we would. Contact me via IRC or email and we'll get the ball rolling.
Comment 17 Johan Bergström 2011-11-14 12:27:14 UTC
Created attachment 292515 [details]
pgbouncer-1.4.2.ebuild

Fixes:
 - EAPI=4
 - Clean up deps
 - Switch to the postgres src_uri mirrors

None of this would of course happen if Aaron didn't help out. Thanks!
Comment 18 Johan Bergström 2011-11-14 12:29:29 UTC
Created attachment 292517 [details]
pgbouncer.initd

Changes:
 - Create rundir if it doesn't exist
 - Switch from opts to extra_started_commands

Again: Thanks to Aaron W. Swenson!
Comment 19 Aaron W. Swenson gentoo-dev 2011-11-16 04:18:31 UTC
  16 Nov 2011; Aaron W. Swenson <titanofold@gentoo.org>
  +pgbouncer-1.4.2.ebuild, +files/pgbouncer.initd, +metadata.xml:
  Initial commit. Ebuild written by Johan Bergström <bugs@bergstroem.nu>.
  Fixes bug 243232.