Reading supplementary groups is too slow

Bug #364669 reported by Andrew Pollock
8
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Medium
Martin Pitt

Bug Description

Binary package hint: postgresql-common

I'm using the Postgresql packages in an environment having 6,000+ local groups.
In this situation, the change_uid function in PgCommon.pm is unbearably slow. e.g.:

apollock@procrastination:~$ sudo time perl -I /usr/share/postgresql-common/ -MPgCommon -e 'change_ugid(29,29)'

4540.63user 426.61system 1:22:49elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+678714minor)pagefaults 0swaps

This has already been fixed in version 90 of postgresql-common, and fixed in Intrepid and later. I'd like this to be fixed in Hardy as well. I will provide a minimal patch against 87

SRU justification: Makes standard PostgreSQL operations, such as starting the cluster from the init script, unbearably slow in environments with many users/groups.
Patch: http://bazaar.launchpad.net/~pitti/postgresql/common/revision/873 (in production use for over half a year without apparent regressions).
Test case: see above

For verification, you should also run the test suite with
  sudo /usr/share/postgresql-common/testsuite
This provides a very comprehensive integration test (> 1000 test cases). If that fails for you (I might have some system specific assumptions in there), please compare with the results with the hardy final postgresql-common.

Revision history for this message
Martin Pitt (pitti) wrote :

The necessary change is

  http://bazaar.launchpad.net/~pitti/postgresql/common/revision/873

I'm ok with backporting this.

Changed in postgresql-common (Ubuntu):
status: New → Fix Released
Changed in postgresql-common (Ubuntu Hardy):
status: New → Triaged
Martin Pitt (pitti)
Changed in postgresql-common (Ubuntu Hardy):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Andrew Pollock (apollock) wrote :

Terrific, thanks. Do you want a debdiff or are you good to do the whole thing?

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 364669] Re: Reading supplementary groups is too slow

Andrew Pollock [2009-04-22 15:03 -0000]:
> Terrific, thanks. Do you want a debdiff or are you good to do the
> whole thing?

That's fine, I can just cherrypick the commit. However, I'd appreciate
if you could test the package in -proposed (once uploaded) to have a
four-eyes verification process.

Revision history for this message
Andrew Pollock (apollock) wrote :

Sure thing

Revision history for this message
Martin Pitt (pitti) wrote :

I uploaded the backport now, sorry for dragging this so long! This needs Steve or Colin to process now.

Changed in postgresql-common (Ubuntu Hardy):
status: Triaged → Fix Committed
importance: Undecided → Medium
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

Accepted into hardy-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Andrew, can you please give this some testing? Thanks in advance!

Revision history for this message
Joel Ebel (jbebel) wrote :

I've testing this package, and it does start very quickly compared to the current hardy version.

Martin Pitt (pitti)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postgresql-common - 87ubuntu1

---------------
postgresql-common (87ubuntu1) hardy-proposed; urgency=low

  * PgCommon.pm, change_ugid(): Use /usr/bin/id instead of manual parsing with
    getgrent(), which is reportedly magnitudes faster for environments with
    a large number of groups in remote databases. (LP: #364669, Debian #491136)
    Patch backported from trunk r873 (applied in Ubuntu 8.10 and later).

 -- Martin Pitt <email address hidden> Sun, 19 Jul 2009 15:13:15 +0200

Changed in postgresql-common (Ubuntu Hardy):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.