Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 868393 - dev-db/postgresql: enable threads by default (IUSE="threads")
Summary: dev-db/postgresql: enable threads by default (IUSE="threads")
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 868336
  Show dependency tree
 
Reported: 2022-09-04 08:19 UTC by Holger Hoffstätte
Modified: 2023-09-19 12:46 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2022-09-04 08:19:06 UTC
Postgres has default-enabled phread support for lock support in the server and thread-safety of the client lib. Work scalability is achieved via multiprocess support. Consider enabling pthreads unconditionally and removing the +threads flag.


Reproducible: Always
Comment 1 Holger Hoffstätte 2022-09-04 08:23:15 UTC
Small correction: IUSE="threads" is off by default. It probably only affects the thread-safety of the client library, which is single-threaded and blocking (last I checked). That being said, I don't see the harm to make it pthreads-aware by default.
Comment 2 Holger Hoffstätte 2022-09-24 13:01:08 UTC
Quote from https://www.postgresql.org/docs/current/install-procedure.html#CONFIGURE-OPTIONS:

--snip--
Anti-Features:

--disable-thread-safety
    Disable the thread-safety of client libraries. This prevents concurrent threads in libpq and ECPG programs from safely controlling their private connection handles. Use this only on platforms with deficient threading support.
--snip--

So it seems that Gentoo's default of not enabling thread support by default (or unconditionally) is actually wrong.
Comment 3 Holger Hoffstätte 2022-09-25 07:58:31 UTC
Added a PR only for unkeyworded 15_beta4 and -9999 instead upsetting the apple cart with unstable revbumps.
Comment 4 Holger Hoffstätte 2022-09-25 09:07:15 UTC
Sorry for the noise, apparently this cannot be fixed without actually upsetting the apple cart due to !"§$ reverse depencies on postgresql[threads].
Comment 5 Aaron W. Swenson gentoo-dev 2023-08-07 11:51:04 UTC
(In reply to Holger Hoffstätte from comment #4)
> Sorry for the noise, apparently this cannot be fixed without actually
> upsetting the apple cart due to !"§$ reverse depencies on
> postgresql[threads].

Meh, we can touch the packages to remove that restriction. There's only a handful that need the USE flag dependency removed.
Comment 6 Larry the Git Cow gentoo-dev 2023-09-18 10:54:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c052809c73c645dc43115cc019c83a8c02ddbd8e

commit c052809c73c645dc43115cc019c83a8c02ddbd8e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-18 10:53:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-18 10:54:27 +0000

    app-backup/bareos: prepare for postgresql to remove USE=threads
    
    It's always available in newer versions.
    
    Bug: https://bugs.gentoo.org/868393
    Signed-off-by: Sam James <sam@gentoo.org>

 .../bareos/{bareos-20.0.8-r1.ebuild => bareos-20.0.8-r2.ebuild}       | 2 +-
 .../bareos/{bareos-21.1.7-r1.ebuild => bareos-21.1.7-r2.ebuild}       | 4 ++--
 app-backup/bareos/{bareos-22.1.0.ebuild => bareos-22.1.0-r1.ebuild}   | 4 ++--
 app-backup/bareos/bareos-9999.ebuild                                  | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de2d40f893d33aa020d73161050c3af3cb16aa9c

commit de2d40f893d33aa020d73161050c3af3cb16aa9c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-18 10:52:47 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-18 10:54:27 +0000

    app-backup/bacula: prepare for postgresql to remove USE=threads
    
    It's always available in newer versions.
    
    Bug: https://bugs.gentoo.org/868393
    Signed-off-by: Sam James <sam@gentoo.org>

 app-backup/bacula/{bacula-11.0.6-r2.ebuild => bacula-11.0.6-r4.ebuild} | 2 +-
 app-backup/bacula/{bacula-11.0.6-r3.ebuild => bacula-11.0.6-r5.ebuild} | 2 +-
 app-backup/bacula/{bacula-13.0.2-r1.ebuild => bacula-13.0.2-r2.ebuild} | 2 +-
 app-backup/bacula/{bacula-13.0.3.ebuild => bacula-13.0.3-r1.ebuild}    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d348afcc2e04147b3a160e5c6fa838ae2788c3bd

commit d348afcc2e04147b3a160e5c6fa838ae2788c3bd
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-18 10:51:43 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-18 10:54:27 +0000

    dev-ruby/pg: prepare for postgresql to remove USE=threads
    
    It's always available in newer versions.
    
    Bug: https://bugs.gentoo.org/868393
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-ruby/pg/{pg-1.4.6.ebuild => pg-1.4.6-r1.ebuild} | 2 +-
 dev-ruby/pg/{pg-1.5.3.ebuild => pg-1.5.3-r1.ebuild} | 2 +-
 dev-ruby/pg/{pg-1.5.4.ebuild => pg-1.5.4-r1.ebuild} | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2023-09-18 10:58:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fd570cb131ea7f51a63dee06ae81b857af91c4b

commit 1fd570cb131ea7f51a63dee06ae81b857af91c4b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-18 10:58:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-18 10:58:13 +0000

    dev-db/slony1: prepare for postgresql to remove USE=threads
    
    It's always available in newer versions.
    
    Bug: https://bugs.gentoo.org/868393
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-db/slony1/{slony1-2.2.10.ebuild => slony1-2.2.10-r1.ebuild} | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-09-18 11:11:38 UTC
(In reply to Aaron W. Swenson from comment #5)
> (In reply to Holger Hoffstätte from comment #4)
> > Sorry for the noise, apparently this cannot be fixed without actually
> > upsetting the apple cart due to !"§$ reverse depencies on
> > postgresql[threads].
> 
> Meh, we can touch the packages to remove that restriction. There's only a
> handful that need the USE flag dependency removed.

All handled.

Can we please fix the older pg versions by changing to IUSE="+threads" or just hard-enable it? This is clearly broken wrt the upstream recommendation.

It's been sitting for over a year.
Comment 9 Larry the Git Cow gentoo-dev 2023-09-19 12:46:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d19efc5363478abe880f136aa296c7926cb3532

commit 7d19efc5363478abe880f136aa296c7926cb3532
Author:     Aaron W. Swenson <titanofold@gentoo.org>
AuthorDate: 2023-09-19 12:44:30 +0000
Commit:     Aaron W. Swenson <titanofold@gentoo.org>
CommitDate: 2023-09-19 12:45:54 +0000

    dev-db/postgresql: Drop threads use flag
    
    Closes: https://bugs.gentoo.org/868393
    Signed-off-by: Aaron W. Swenson <titanofold@gentoo.org>

 dev-db/postgresql/postgresql-11.21.ebuild | 6 ++----
 dev-db/postgresql/postgresql-12.16.ebuild | 6 ++----
 dev-db/postgresql/postgresql-13.12.ebuild | 6 ++----
 dev-db/postgresql/postgresql-14.9.ebuild  | 6 ++----
 dev-db/postgresql/postgresql-15.4.ebuild  | 6 ++----
 dev-db/postgresql/postgresql-16.0.ebuild  | 7 +++----
 dev-db/postgresql/postgresql-9999.ebuild  | 6 ++----
 7 files changed, 15 insertions(+), 28 deletions(-)